如何解决从 location.hash 或 url hash 设置选项卡处于活动状态 下面用于设置 <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script> 的 Tab import { NgModule } from '@angular/core'; import { Common
下面用于设置 <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
的 Tab import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TodoRoutingModule } from './todo-routing.module';
import { ListingComponent } from './components/listing/listing.component';
import { AddComponent } from './components/add/add.component';
import { ReactiveFormsModule } from '@angular/forms';
import { GraphComponent } from './components/graph/graph.component';
import { SharedModule } from 'src/app/shared/shared.module';
import { NbCheckboxModule,NbIconModule,NbTabsetModule } from '@nebular/theme';
import { ChartsModule } from 'ng2-charts';
import { TrendComponent } from './components/trend/trend.component';
import { AlarmComponent } from './components/alarm/alarm.component';
import { DoughnutChartComponent,PieChartComponent,BarChartComponent } from 'angular-d3-charts'; // this is needed!
@NgModule({
// tslint:disable-next-line:max-line-length
declarations: [ListingComponent,AddComponent,GraphComponent,TrendComponent,AlarmComponent,DoughnutChartComponent,BarChartComponent ],imports: [
CommonModule,ReactiveFormsModule,TodoRoutingModule,SharedModule,ChartsModule,NbTabsetModule,NbCheckboxModule
],exports: [ListingComponent,AlarmComponent],providers: []
})
export class TodoModule { }
的脚本无法正常工作
- 如果没有
.active
的页面加载会破坏整个点击功能 - 但如果页面加载 WITH
window.location.hash
一切正常
hash
SetTab(index) 代码:
hash
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。