Authored by TaoHuang

fix

... ... @@ -46,60 +46,60 @@
</template>
<script>
import { Scroll } from 'cube-ui';
import Banner from './banner';
import { createNamespacedHelpers } from 'vuex';
const { mapState, mapActions } = createNamespacedHelpers('gain');
export default {
data() {
return {
scrollOptions: {
bounce: {
top: false
},
pullUpLoad: true
import { Scroll } from 'cube-ui';
import Banner from './banner';
import { createNamespacedHelpers } from 'vuex';
const { mapState, mapActions } = createNamespacedHelpers('gain');
export default {
data() {
return {
scrollOptions: {
bounce: {
top: false
},
fixed: false
};
},
mounted() {
this.fetchList();
this.fetchResource().then(() => {
this.$nextTick(() => {
this.$refs.scroll.$forceUpdate();
});
pullUpLoad: true
},
fixed: false
};
},
mounted() {
this.fetchList();
this.fetchResource().then(() => {
this.$nextTick(() => {
this.$refs.scroll.$forceUpdate();
});
},
methods: {
...mapActions(['fetchList', 'fetchResource']),
});
},
methods: {
...mapActions(['fetchList', 'fetchResource']),
async onPullingUp() {
const result = await this.fetchList();
async onPullingUp() {
const result = await this.fetchList();
if (!result) {
this.$refs.scroll.$forceUpdate();
}
},
scroll({ y }) {
const height = this.$refs.banner.$el.offsetHeight + this.$refs.header.offsetHeight;
if (-y >= height) {
this.fixed = true;
} else {
this.fixed = false;
}
if (!result) {
this.$refs.scroll.$forceUpdate();
}
},
computed: {
...mapState(['list']),
},
components: {
Scroll,
Banner
scroll({ y }) {
const height = this.$refs.banner.$el.offsetHeight + this.$refs.header.offsetHeight;
if (-y >= height) {
this.fixed = true;
} else {
this.fixed = false;
}
}
};
},
computed: {
...mapState(['list']),
},
components: {
Scroll,
Banner
}
};
</script>
<style lang="scss" scoped>
... ...