refs #1766 Introduce vue-virtual-scroll in SideBar/Follows

This commit is contained in:
AkiraFukushima 2020-10-20 01:15:01 +09:00
parent 4b36d8f4e1
commit d2a808b650
1 changed files with 15 additions and 11 deletions

View File

@ -1,15 +1,19 @@
<template> <template>
<div id="follows"> <div id="follows">
<template v-for="follow in follows"> <DynamicScroller :items="follows" :min-item-size="53" class="scroller" page-mode>
<user <template v-slot="{ item, index, active }">
:user="follow" <DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item.item]" :data-index="index">
v-bind:key="follow.id" <user
:relationship="targetRelation(follow.id)" :user="item"
@followAccount="followAccount" v-bind:key="item.id"
@unfollowAccount="unfollowAccount" :relationship="targetRelation(item.id)"
> @followAccount="followAccount"
</user> @unfollowAccount="unfollowAccount"
</template> >
</user>
</DynamicScrollerItem>
</template>
</DynamicScroller>
</div> </div>
</template> </template>
@ -31,7 +35,7 @@ export default {
this.load() this.load()
}, },
watch: { watch: {
account: function(_newAccount, _oldAccount) { account: function (_newAccount, _oldAccount) {
this.load() this.load()
} }
}, },