The @hyhello/vue-cron component for vue2, supports single page applications.
codepen.io
install @hyhello/vue-cron
npm install @hyhello / vue - cron -- save
// global use
import Vue from 'vue';
import vueCron from '@hyhello/vue-cron';
Vue.use(vueCron);
// or Local use
import { Cron } from '@hyhello/vue-cron';
export default {
components: { Cron }
};
< style >
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 15px;
text-align: center;
}
</ style >
< template >
< vue-cron v-model ="value " @change ="change "> </ vue-cron >
</ template >
< script >
import { Cron as vueCron } from '@hyhello/vue-cron' ;
export default {
components : { vueCron } ,
data : function ( ) {
return {
value : null
} ;
} ,
methods : {
change ( val ) {
console . log ( 'value:' , val ) ;
}
}
} ;
</ script >
参数
说明
类型
可选值
默认值
value/v-model
需要绑定的值
string
—
-
disabled
是否禁用
boolean
true / false
false
readonly
是否只读
boolean
true / false
false
事件名
说明
回调参数
change
监听值变化
变化后的值