vue-countdown
v1.0.4
Published
基于vuejs的倒计时组件
Downloads
759
Readme
vue-countdown
一款基于 vuejs 的倒计时组件
安装
npm install --save vue-countdown
options
- time 倒计时时间,默认
60s
- normalText 常规(未进入倒计时)状态下的提示文字,默认
获取验证码
- waitingText 倒计时状态下的提示文字,默认
重新获取
events
- plan 用户点击后触发,向父级派发该事件
- ready 触发组件开始进入倒计时状态,由父级触发
在你的vue项目中进行使用(with ES6)
import countdown from 'vue-countdown';
export default {
components:{
countdown
},
methods:{
plan:function(){ //用户点击后准备进入倒计时状态
//父级逻辑校验
/**
* some code
*/
//校验通过后广播ready事件
this.$broadcast("ready");
}
}
}
<countdown @plan="plan"></countdown>