Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tabs] panel使用wx:if后加载时,tab顺序、panel顺序和panel高度错乱 #3402

Open
prprprPro opened this issue Dec 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@prprprPro
Copy link

prprprPro commented Dec 26, 2024

tdesign-miniprogram 版本

1.8.4

重现链接

https://developers.weixin.qq.com/s/GinDHJm27eWo

重现步骤

t-tabs组件包含若干个t-tab-panel,其中部分使用了wx:if加载,请查看代码片段。
如果wx:if的组件在前,则tab顺序错乱,panel内容正确,panel高度错乱。
如果wx:if的组件在后,则tab顺序错乱,panel内容错乱,panel高度正确。

我感觉是不是要给tab-panel加个sort属性,看了一下tabs.js的line43-45:

linked(target) {
    this.children.push(target);
    this.initChildId();
    target.index = this.children.length - 1;
    this.updateTabs();
}

很明显是后加载的panel在后面,而panel的位置是按组件位置的。

期望结果

No response

实际结果

No response

基础库版本

No response

补充说明

No response

Copy link
Contributor

👋 @prprprPro,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao anlyyao added the enhancement New feature or request label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants