Commit 5a12c415 authored by chenqikuai's avatar chenqikuai

fix

parent c02424fb
...@@ -44,13 +44,13 @@ export default Vue.extend({ ...@@ -44,13 +44,13 @@ export default Vue.extend({
handleChange(v: number) { handleChange(v: number) {
this.index = v this.index = v
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
this.timer = setInterval(() => { this.timer = window.setInterval(() => {
this.index < 4 ? this.index++ : this.index = 1 this.index < 4 ? this.index++ : this.index = 1
}, 4000) }, 4000)
} }
}, },
created() { created() {
this.timer = setInterval(() => { this.timer = window.setInterval(() => {
this.index < 4 ? this.index++ : this.index = 1 this.index < 4 ? this.index++ : this.index = 1
}, 4000) }, 4000)
}, },
......
...@@ -16,7 +16,7 @@ export default Vue.extend({ ...@@ -16,7 +16,7 @@ export default Vue.extend({
mounted() { mounted() {
this.caculateTime() this.caculateTime()
if (this.Timer === 0) if (this.Timer === 0)
this.Timer = setInterval(() => { this.Timer = window.setInterval(() => {
this.caculateTime() this.caculateTime()
}, 1000) }, 1000)
}, },
......
...@@ -47,13 +47,13 @@ export default Vue.extend({ ...@@ -47,13 +47,13 @@ export default Vue.extend({
handleChange(v: number) { handleChange(v: number) {
this.index = v this.index = v
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
this.timer = setInterval(() => { this.timer = window.setInterval(() => {
this.index < 4 ? this.index++ : this.index = 1 this.index < 4 ? this.index++ : this.index = 1
}, 4000) }, 4000)
} }
}, },
created() { created() {
this.timer = setInterval(() => { this.timer = window.setInterval(() => {
this.index < 4 ? this.index++ : this.index = 1 this.index < 4 ? this.index++ : this.index = 1
}, 4000) }, 4000)
}, },
......
...@@ -154,7 +154,7 @@ export default Vue.extend({ ...@@ -154,7 +154,7 @@ export default Vue.extend({
}, },
initTimer() { initTimer() {
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
this.timer = setInterval(() => { this.timer = window.setInterval(() => {
this.index++ this.index++
this.clickChange(this.index) this.clickChange(this.index)
if (this.index === 13) { if (this.index === 13) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment