Skip to content

Commit

Permalink
fix(tabs): 修复tab-panel高度变化影响内部组件问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaikai committed Aug 7, 2024
1 parent df2e357 commit 2c59a31
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tab-panel/tab-panel.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<view
class="class {{prefix}}-class {{classPrefix}} {{active ? prefix + '-is-active': ''}}"
style="{{_._style([style, customStyle, (hide ? 'height: 0' : '')])}}"
style="{{_._style([style, customStyle, (hide ? 'display: none' : '')])}}"
id="{{id}}"
aria-role="tabpanel"
>
Expand Down
1 change: 1 addition & 0 deletions src/tabs/_example/with-content/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Component({
data: {
tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
animation: { duration: 0.5 },
},
methods: {
onTabsChange(event) {
Expand Down
1 change: 1 addition & 0 deletions src/tabs/_example/with-content/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
bind:click="onTabsClick"
t-class="custom-tabs"
t-class-content="custom-panel"
animation="{{animation}}"
>
<t-tab-panel label="选项一" value="0" style="{{tabPanelstyle}}">选项一内容</t-tab-panel>
<t-tab-panel label="选项二" value="1" style="{{tabPanelstyle}}">选项二内容</t-tab-panel>
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/_example/with-content/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
}

.custom-panel {
height: 120px;
height: 120px !important;
color: var(--td-text-color-primary);
}

0 comments on commit 2c59a31

Please sign in to comment.