答案就是使用ref即可。
<countdown ref="countdown"></countdown>
beforeDestroy () {
// 切换页面时消灭计时器
this.$refs.countdown.clearTimer()
}
CyLee 2018-02-07 09:42 原文
答案就是使用ref即可。
<countdown ref="countdown"></countdown>
beforeDestroy () {
// 切换页面时消灭计时器
this.$refs.countdown.clearTimer()
}