mali-vue-datetime
v0.0.9
Published
mali-vue-datetime-component
Downloads
9
Readme
mali-vue-datetime
mali-vue-datetime-component
Build Setup
npm i mali-vue-datetime -S
require
//main.js
import maliVueDatetime from 'mali-vue-datetime'
Vue.use(maliVueDatetime);
API
| 参数 |说明 | 类型 | 可选值 | 默认值 | | - | :-: |:-:|:-:| :-:|-: | | timeType |时间格式 | String | 'datetime', 'date', 'time' |date|
Events
| 事件名称 | 说明 | 回调参数| | - | :-: | -: | |showTime|获取时间 |formatTime,timestamp|
<template>
<div id="app">
<div @click="openTimePicker('picker1')">datetime {{formatTime}} {{timestamp}}</div>
<mali-vue-datetime
ref="picker1"
timeType="date"
@showTime="getSelectTime"></mali-vue-datetime>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
formatTime:null,
timestamp:null,
}
},
methods:{
openTimePicker(picker){
this.$refs[picker].open();
},
getSelectTime(formatTime,timestamp){
this.formatTime=formatTime;
this.timestamp=timestamp;
}
}
}
</script>