【发布时间】:2018-12-05 07:08:56
【问题描述】:
我必须设置一个重定向到主屏幕的 10 分钟计时器。此外,它必须在每个动作(例如按钮按下)上重置。我找到了这个计时器:https://github.com/fengyuanchen/vue-countdown 是否可以在操作时重新启动它?
<countdown ref="countdown" @end="dosmth()" :time="time" :auto-start="false">
<template slot-scope="props">{{ props.seconds }}</template>
</countdown>
mounted() {
this.$refs.countdown.start();
},
dosmth: function(){
this.$refs.countdown.start();
}
这应该重新启动计时器,但即使这样也不起作用:
篮子.vue:378 [Vue 警告]:“end”的事件处理程序出错:“InternalError: too much recursion”
也许有人可以帮助我?
【问题讨论】:
-
nvm 想通了:this.$refs.countdown.totalMilliseconds = time;
标签: javascript vue.js countdown