...
|
...
|
@@ -4,14 +4,9 @@ |
|
|
<div class="back" @click="handleBack">
|
|
|
<i class="iconfont icon-left"></i>
|
|
|
</div>
|
|
|
{{ count }}评论
|
|
|
</div>
|
|
|
<Scroll class="scroll-wrapper" ref="scroll" :options="scrollOptions">
|
|
|
<div v-for="i in list" class="item">huangtao {{i}}</div>
|
|
|
</Scroll>
|
|
|
<div class="footer">
|
|
|
<div class="input">评论</div>
|
|
|
{{ count > 0 ? count + '条' : '' }}评论
|
|
|
</div>
|
|
|
<CommentList class="scroll-wrapper" :dest-id="destId" :column-type="1001" @on-page-change="onPageChange" v-if="destId"></CommentList>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
...
|
...
|
@@ -21,6 +16,14 @@ import {Scroll} from 'cube-ui'; |
|
|
|
|
|
export default {
|
|
|
name: 'CommentScrollView',
|
|
|
props: {
|
|
|
destId: {
|
|
|
type: [Number, String],
|
|
|
default() {
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
Scroll
|
|
|
},
|
...
|
...
|
@@ -29,32 +32,16 @@ export default { |
|
|
list: [],
|
|
|
scrollOptions: {
|
|
|
bounce: false
|
|
|
}
|
|
|
},
|
|
|
count: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
count() {
|
|
|
return this.list.length > 0 ? this.list.length + '条' : '';
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
click() {
|
|
|
this.$nextTick(() => {
|
|
|
this.initData();
|
|
|
this.forceUpdate();
|
|
|
}, 1000);
|
|
|
},
|
|
|
forceUpdate() {
|
|
|
this.$refs.scroll.forceUpdate();
|
|
|
},
|
|
|
initData() {
|
|
|
console.log('click')
|
|
|
for (let i = 0; i < 100; i++) {
|
|
|
this.list.push(i);
|
|
|
}
|
|
|
},
|
|
|
handleBack() {
|
|
|
this.$emit('on-back');
|
|
|
},
|
|
|
onPageChange({size}) {
|
|
|
this.count = size;
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|