-
Notifications
You must be signed in to change notification settings - Fork 159
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
[TIndexes] 使用异步数据加载时,索引链接失效 #1619
Labels
Comments
👋 @hizhangbo,感谢给 TDesign 提出了 issue。 |
@hizhangbo 辛苦贴一下完整的可复现代码,我简单在示例上使用setTimeout延迟索引indexList,未能复现你的问题 |
<template>
<div class="component-wrap">
<t-indexes :index-list="indexList">
<template v-for="item in list" :key="item.index">
<t-indexes-anchor :index="item.index" />
<t-cell-group>
<t-cell v-for="(val, i) in item.children" :key="i" :title="val" />
</t-cell-group>
</template>
</t-indexes>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
const list = ref([]);
const indexList = ref([]);
onMounted(() => {
setTimeout(() => {
list.value = [
{
index: 'A',
children: [
'阿坝123',
'阿拉善',
'阿里',
'安康',
'安庆',
'鞍山',
'安顺',
'安阳',
'澳门',
],
},
{
index: 'B',
children: [
'北京',
'白银',
'保定',
'宝鸡',
'保山',
'包头',
'巴中',
'北海',
'蚌埠',
'本溪',
'毕节',
'滨州',
'百色',
'亳州',
],
},
{
index: 'C',
children: [
'重庆',
'成都',
'长沙',
'长春',
'沧州',
'常德',
'昌都',
'长治',
'常州',
'巢湖',
'潮州',
'承德',
'郴州',
'赤峰',
'池州',
'崇左',
'楚雄',
'滁州',
'朝阳',
],
},
{
index: 'D',
children: [
'大连',
'东莞',
'大理',
'丹东',
'大庆',
'大同',
'大兴安岭',
'德宏',
'德阳',
'德州',
'定西',
'迪庆',
'东营',
],
},
{
index: 'E',
children: ['鄂尔多斯', '恩施', '鄂州'],
},
{
index: 'F',
children: ['福州', '防城港', '佛山', '抚顺', '抚州', '阜新', '阜阳'],
},
{
index: 'G',
children: [
'广州',
'桂林',
'贵阳',
'甘南',
'赣州',
'甘孜',
'广安',
'广元',
'贵港',
'果洛',
],
},
{
index: 'J',
children: [
'揭阳',
'吉林',
'晋江',
'吉安',
'胶州',
'嘉兴',
'济南',
'鸡西',
'荆州',
'江门',
'基隆',
],
},
{
index: 'K',
children: ['昆明', '开封', '康定', '喀什'],
},
];
indexList.value = list.value.map((item) => item.index);
}, 2000);
});
</script>
<style lang="less">
.component-wrap {
height: calc(100vh - 50px);
}
</style> |
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tdesign-mobile-vue 版本
1.4.3
重现链接
No response
重现步骤
期望结果
No response
实际结果
No response
框架版本
No response
浏览器版本
No response
系统版本
No response
Node版本
No response
补充说明
groupTop 通过异步加载数据时,长度一直为0
The text was updated successfully, but these errors were encountered: