File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
devui/virtual-list/src/components
docs/components/virtual-list Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ export default defineComponent({
2424 top : 0 ,
2525 } ;
2626 }
27+ } , {
28+ immediate : true ,
2729 } ) ;
2830
2931 return ( ) => (
Original file line number Diff line number Diff line change 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>
You can’t perform that action at this time.
0 commit comments