diff --git a/src/app/demo/tab/basic/demo.component.html b/src/app/demo/tab/basic/demo.component.html index c74bf622b1..a47cbb93e3 100644 --- a/src/app/demo/tab/basic/demo.component.html +++ b/src/app/demo/tab/basic/demo.component.html @@ -5,7 +5,7 @@
- +
tab 1
tab content 1 diff --git a/src/jigsaw/component/tabs/index.ts b/src/jigsaw/component/tabs/index.ts index f5488c4ffa..b1eff1b8a8 100644 --- a/src/jigsaw/component/tabs/index.ts +++ b/src/jigsaw/component/tabs/index.ts @@ -8,9 +8,10 @@ import {JigsawTab} from './tab'; import {JigsawTabPane} from "./tab-pane"; import {CommonModule} from "@angular/common"; import {JigsawTabContent, JigsawTabLabel} from "./tab-item"; +import {PerfectScrollbarModule} from "ngx-perfect-scrollbar"; @NgModule({ - imports: [CommonModule], + imports: [CommonModule, PerfectScrollbarModule], exports: [JigsawTab, JigsawTabPane], declarations: [JigsawTab, JigsawTabPane, JigsawTabLabel, JigsawTabContent], providers: [], diff --git a/src/jigsaw/component/tabs/tab.html b/src/jigsaw/component/tabs/tab.html index 2123d2618e..267fea9c09 100644 --- a/src/jigsaw/component/tabs/tab.html +++ b/src/jigsaw/component/tabs/tab.html @@ -23,7 +23,8 @@
-
+
{ + // 等待dom渲染 + this._$contentHeight = this._elementRef.nativeElement.offsetHeight - 46 + 'px'; + }) + } + } + ngAfterViewInit() { if (this.selectedIndex != null) { this._handleSelectChange(this.selectedIndex)