|
@@ -116,6 +116,7 @@
|
|
bodyHeight +
|
|
bodyHeight +
|
|
'px);overflow: hidden;'
|
|
'px);overflow: hidden;'
|
|
"
|
|
"
|
|
|
|
+ :key="showindex"
|
|
>
|
|
>
|
|
<div id="demo1">
|
|
<div id="demo1">
|
|
<div
|
|
<div
|
|
@@ -214,6 +215,7 @@ export default {
|
|
bodyunitfontsize: "",
|
|
bodyunitfontsize: "",
|
|
bodyunitfontfamily: "",
|
|
bodyunitfontfamily: "",
|
|
bodyunitcolor: "",
|
|
bodyunitcolor: "",
|
|
|
|
+ marqueeTimer: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -221,8 +223,9 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
marquee() {
|
|
marquee() {
|
|
|
|
+ clearTimeout(this.marqueeTimer);
|
|
let speed = 100;
|
|
let speed = 100;
|
|
- setTimeout(() => {
|
|
|
|
|
|
+ this.marqueeTimer = setTimeout(() => {
|
|
let demo = document.getElementById("demo");
|
|
let demo = document.getElementById("demo");
|
|
let demo1 = document.getElementById("demo1");
|
|
let demo1 = document.getElementById("demo1");
|
|
let demo2 = document.getElementById("demo2");
|
|
let demo2 = document.getElementById("demo2");
|
|
@@ -331,6 +334,7 @@ export default {
|
|
this.showindex = item.value;
|
|
this.showindex = item.value;
|
|
this.righttitle = item.name;
|
|
this.righttitle = item.name;
|
|
this.changeTime();
|
|
this.changeTime();
|
|
|
|
+ this.marquee();
|
|
},
|
|
},
|
|
// 自动切换
|
|
// 自动切换
|
|
changeTime() {
|
|
changeTime() {
|
|
@@ -343,11 +347,14 @@ export default {
|
|
}
|
|
}
|
|
this.changeIndex(this.titleData[this.showindex]);
|
|
this.changeIndex(this.titleData[this.showindex]);
|
|
}, 15 * 1000);
|
|
}, 15 * 1000);
|
|
|
|
+ this.marquee();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
|
+ clearTimeout(this.marqueeTimer);
|
|
clearInterval(this.newTimer);
|
|
clearInterval(this.newTimer);
|
|
clearInterval(this.changeTimer);
|
|
clearInterval(this.changeTimer);
|
|
|
|
+ this.marqueeTimer = null;
|
|
this.changeTimer = null;
|
|
this.changeTimer = null;
|
|
this.newTimer = null;
|
|
this.newTimer = null;
|
|
},
|
|
},
|