Authored by yyq

fix

... ... @@ -71,6 +71,10 @@ export default {
default() {
return [];
}
},
manualInit: {
type: Boolean,
default: false
}
},
computed: {
... ... @@ -120,7 +124,10 @@ export default {
window.addEventListener('test', null, opts);
} catch (e) {} //eslint-disable-line
this.$el.addEventListener(EVENT_SCROLL, this.scrollEvent, supportsPassive ? { passive: true } : false);
this.init();
if (!this.manualInit) {
this.init();
}
},
beforeDestroy() {
this.$el.removeEventListener(EVENT_SCROLL, this.scrollEvent);
... ...
... ... @@ -84,6 +84,10 @@ export default {
cols: {
type: Number,
default: 2
},
manualInit: {
type: Boolean,
default: false
}
},
computed: {
... ... @@ -120,7 +124,9 @@ export default {
} catch (e) {} //eslint-disable-line
this.$el.addEventListener(EVENT_SCROLL, this.onScroll, supportsPassive ? { passive: true } : false);
this.init();
if (!this.manualInit) {
this.init();
}
},
beforeDestroy() {
this.$el.removeEventListener(EVENT_SCROLL, this.onScroll);
... ...
... ... @@ -3,7 +3,7 @@
<Layout class="article">
<TopicHeader ref="header" :title="topicTitle" :step="headerAnimateStep" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicHeader>
<RecycleScrollReveal v-if="topicInfo.viewModel == 2" :size="20" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch"
<RecycleScrollReveal v-if="topicInfo.viewModel == 2" :size="20" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch" :manual-init="true"
@on-inited="onInited">
<template v-slot:eternalTop>
<TopicBanner ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
... ... @@ -24,7 +24,7 @@
</template>
</RecycleScrollReveal>
<LayoutRecycleList v-if="topicInfo.viewModel == 1" :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch"
<LayoutRecycleList v-if="topicInfo.viewModel == 1" :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch" :manual-init="true"
@on-inited="onInited">
<template class="article-item" #item="{ data }">
<TopicBanner v-if="data.data.topicHead" ref="topicHead" :data="topicInfo" :share="share" @on-follow="onFollowTopic"></TopicBanner>
... ... @@ -240,8 +240,6 @@ export default {
}
},
init() {
let reload = this.page > 1;
this.page = 1;
this.fetchTopicSimpleInfo({topicId: this.topicId}).then(res => {
if (this.share && !this.$yoho.isApp && res.code === 200) {
... ... @@ -254,12 +252,7 @@ export default {
if (this.$refs.scroll) {
this.$refs.scroll.$el.scrollTop = 0;
if (reload) {
setTimeout(() => {
this.$refs.scroll.init();
}, 200);
}
this.$refs.scroll.init();
}
});
},
... ... @@ -399,6 +392,14 @@ export default {
z-index: 1;
}
/deep/ .cube-recycle-list-items {
padding-top: 34PX;
.cube-recycle-list-item:first-child {
margin-top: -34PX;
}
}
.publish-btn {
width: 260px;
height: 80px;
... ...