Closed brant9527 closed 7 years ago
- <template> - <iscroll-view class="scroll-view" ref="iscroll" @pullUp="load" @pullDown="refresh"> - <card v-for="item in cardList" v-bind:item="item" :key="item.id"></card> - </iscroll-view> - </template>
js code
computed: { ...mapGetters([ 'cardList' ]) },
mounted() { /* Get the reference of the scroller */ this.$refs.iscroll.refresh() (iscroll才有实例,iscrollView 提示undefind) }
现象描述:第一次数据请求回来时,渲染结果如图 但是不能滑动,怀疑高度为0(之前只用 iscroll 时,数组改动时需要refresh,怀疑是refresh 无效),接着,点击进入别的页面,在正常跳转回这个页面时,页面滚动生效。
你要在更新视图的下一个 tick 执行 refresh。
谢谢
js code
现象描述:第一次数据请求回来时,渲染结果如图 但是不能滑动,怀疑高度为0(之前只用 iscroll 时,数组改动时需要refresh,怀疑是refresh 无效),接着,点击进入别的页面,在正常跳转回这个页面时,页面滚动生效。