canyin-project/yb_wm/components/drag/remind.vue

51 lines
879 B
Vue
Raw Permalink Normal View History

2024-11-01 16:07:54 +08:00
<template>
<view class="remind" v-if="co" :style="{
marginTop: co.marginTop + 'px',
marginBottom: co.marginBottom + 'px'
}">
</view>
</template>
<script>
export default {
name: 'remind',
data() {
return {
img: '../../../static/tubiao/xuanfu.png',
activeIndex: 0,
intnum: undefined
};
},
computed: {
top() {
return -this.activeIndex * 30 + 'px';
}
},
props: ['co'],
mounted() {
// this.ScrollUp();
},
methods: {
ScrollUp() {
// eslint-disable-next-line no-unused-vars
this.intnum = setInterval(_ => {
if (this.activeIndex < this.co.numberList.length) {
this.activeIndex += 1;
} else {
this.activeIndex = 0;
}
}, 1000);
},
Stop() {
clearInterval(this.intnum);
},
Up() {
this.ScrollUp();
}
}
};
</script>
<style lang="scss" scoped>
.remind {}
</style>