vue-time-lewis
v1.0.5
Published
one timepicker plugin for vue
Downloads
15
Readme
vue-time-picker
one timepicker plugin for vue
安装
npm install vue-time-lewis -S
使用
// ES6
import vueTimeLewis from 'vue-time-lewis.js'
// require
var vueTimeLewis = require('TimeLewis')
Vue.use(vueTimeLewis)
// 或者直接使用script导入
<script src="./node_modules/vue/dist/vue-time-lewis.js"></script>
// 作为组件的方式使用
<vue-time-lewis></vue-time-lewis>
example
<template>
<div id="app">
<button @click="vis=true">显示时间控件</button>
<vue-time-lewis
v-if="vis"
@ok="getTime"
@cancel="vis=false"
:suggest-time="suggestTime"
:selected-time="selectedTime"
>
</vue-time-lewis>
</div>
</template>
<script>
export default {
name: "app",
data() {
return {
vis: false,
suggestTime: 42000000,
selectedTime: 42000000
};
},
methods: {
getTime(time) {
console.log(time);
}
}
};
</script>