nativescript-vue 中的 ListView 滚动缓慢
ListView in nativescript-vue slow to scroll
滚动时列表视图很慢。它触及底部并弹起,就像 运行 没有要显示的项目一样。如果您重试,它会让您滚动得更远。同样的事情发生在备份列表的路上。
我使用 vuex 加载了只有 40 个项目的数组 getter。
computed: {
history () {
return this.$store.getters.allHistory;
}
},
那么 ListView 就是
<ListView ref="listView" for="item in history">
<v-template>
<StackLayout height="60" padding="10">
<Label :text="item.title" textWrap="true"></Label>
</StackLayout>/>
</v-template>
</ListView>
移除固定高度和内边距似乎可以解决问题。这正在工作...
<ListView ref="listView" for="item in history">
<v-template>
<GridLayout columns="auto,*" rows="auto, auto" margin="10">
<Image v-show="item.poster_url.length > 0" :src="item.poster_url" marginRight="5"
stretch="aspectFill" height="100" borderRadius="5"></Image>
<StackLayout col="1" row="0" rowSpan="2">
<Label :text="item.title" textWrap="true"></Label>
</StackLayout>
</GridLayout>
</v-template>
</ListView>
滚动时列表视图很慢。它触及底部并弹起,就像 运行 没有要显示的项目一样。如果您重试,它会让您滚动得更远。同样的事情发生在备份列表的路上。
我使用 vuex 加载了只有 40 个项目的数组 getter。
computed: {
history () {
return this.$store.getters.allHistory;
}
},
那么 ListView 就是
<ListView ref="listView" for="item in history">
<v-template>
<StackLayout height="60" padding="10">
<Label :text="item.title" textWrap="true"></Label>
</StackLayout>/>
</v-template>
</ListView>
移除固定高度和内边距似乎可以解决问题。这正在工作...
<ListView ref="listView" for="item in history">
<v-template>
<GridLayout columns="auto,*" rows="auto, auto" margin="10">
<Image v-show="item.poster_url.length > 0" :src="item.poster_url" marginRight="5"
stretch="aspectFill" height="100" borderRadius="5"></Image>
<StackLayout col="1" row="0" rowSpan="2">
<Label :text="item.title" textWrap="true"></Label>
</StackLayout>
</GridLayout>
</v-template>
</ListView>