Skip to content

Commit 22e9409

Browse files
jxhhdxkagol
authored andcommitted
fix: 单词拼写错误、解决虚拟滚动第一次渲染滚动出现异常的问题
1 parent 794ac14 commit 22e9409

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/devui-vue/devui/virtual-list/src/components/container.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export default defineComponent({
2424
top: 0,
2525
};
2626
}
27+
}, {
28+
immediate: true,
2729
});
2830

2931
return () => (

packages/devui-vue/docs/components/virtual-list/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
```vue
1414
<template>
1515
<div style="margin-bottom: 12px">
16-
<d-button @click="onScorllTo" size="sm" style="margin-right: 6px;">scorll to</d-button>
16+
<d-button @click="onScrollTo" size="sm" style="margin-right: 6px;">scorll to</d-button>
1717
<d-input-number v-model="num" placeholder="请输入" :min="0" :max="data.length - 1" size="sm" />
1818
</div>
1919
<d-virtual-list :data="data" ref="vlRef" >
@@ -35,10 +35,10 @@ export default {
3535
);
3636
const num = ref(0);
3737
const vlRef = ref(null);
38-
const onScorllTo = () => {
39-
vlRef.value.onScrollTo(num.value);
38+
const onScrollTo = () => {
39+
vlRef.value.scrollTo(num.value);
4040
};
41-
return { data, num, vlRef, onScorllTo };
41+
return { data, num, vlRef, onScrollTo };
4242
},
4343
};
4444
</script>

0 commit comments

Comments
 (0)