Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
chore(virtual-scroll demo): add scrollIntoItem note
Browse files Browse the repository at this point in the history
  • Loading branch information
b2nil committed Oct 24, 2020
1 parent 66aaeb0 commit 1da1722
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pages/advanced/virtual-scroll/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
@reach-bottom="handleReachBottom"
>
<template #header>
<view
class="example-item__desc"
style="text-align: center;"
> 初始 scrollIntoItem 索引设置: 10 </view>
<at-search-bar
action-name="跳转"
placeholder="header 插槽: 输入需跳转的列表索引"
Expand Down Expand Up @@ -253,7 +257,7 @@ export default defineComponent({
setup() {
const benched = ref(5)
const viewportRows = ref(5)
const length = ref(200)
const length = ref(20)
const itemHeight = ref(80)
const height = ref(300)
const toItem = ref(10)
Expand Down Expand Up @@ -356,7 +360,7 @@ export default defineComponent({
const randIndex = genRandomIndex(colors.value.length)
names.value.push(names.value[randIndex])
surnames.value.push(surnames.value[randIndex])
length.value = 200
length.value = 20
}
})
} else {
Expand All @@ -378,9 +382,9 @@ export default defineComponent({
icon: 'loading',
duration: genRandomIndex(3000),
success: (_) => {
// 模拟加载数据 -> 附加 100 条数据
// 模拟加载数据 -> 附加 10 条数据
setTimeout(() => {
length.value += 100
length.value += 10
loadMore.value.show = false
}, 3000)
}
Expand Down

0 comments on commit 1da1722

Please sign in to comment.