CountDown
引入:
import countDown from 'countDown';
使用:
<count-down :time.sync="120" fore-time-text="fore-time-text" last-time-text="last-time-text" :start.sync="isCountStart"></count-down>
传入参数(props):
time: 倒计时时间(type: Number;单位:秒s);值小于0,则不显示;默认值:60;超过60s会将显示对应转换为默认是
xx时yy分zz秒
;可从 timeUnitObj 传参改变时间单位;start: 是否立即开始(type:Boolean);默认值:false
foreTimeText: 承载倒计时数字span之前标签内容;不传不显示此span;默认值:""
lastTimeText: 承载倒计时数字span之后标签内容;不传不显示此span;默认值:""
如果倒计时结束需要做些事儿,可在调用模块加入如下代码Like This:
events: {
'on-countdown-finish': function (countNum) {
// countNum 统计调用此 countDown 次数;
//Do Something U Want
}
}