fix: bug 图文说明定时器问题

This commit is contained in:
wam
2022-12-01 23:27:53 +08:00
parent 1e57029299
commit d504eb24d5

View File

@@ -195,10 +195,13 @@ export default defineComponent({
}
}
},
showTimeTimeoutId: 0,
};
},
beforeUnmount() {
this.pager.clear();
if(this.showTimeTimeoutId) clearTimeout(this.showTimeTimeoutId);
},
async mounted() {
@@ -220,7 +223,10 @@ export default defineComponent({
this.shopData = buildShopDataDemo(this.scene);
if(this.config.is_show_time && this.config.show_time){
setTimeout(() => this.$emit("next"), this.config.show_time * 1000)
this.showTimeTimeoutId = setTimeout(() => {
this.showTimeTimeoutId = 0;
this.$emit("next");
}, this.config.show_time * 1000)
}
if(this.config.is_three_dimensions) {