约会选择器 (vue-date-picker)
datepicker component for Vue 2.x.
Vue 2.x的datepicker组件。
![vue-date-pickerC](https://i-blog.csdnimg.cn/blog_migrate/affe30524762ee25e5ee597dcbf87448.png)
安装说明 (Instllation)
$ npm install vue-date-picker --save
用法 (Usage)
<template>
<div class="demo">
<datepicker :readonly="true" format="YYYY-MM-DD" name="date1"></datepicker>
<datepicker value="2018-9-5" format="YYYY-M-D" name="date2"></datepicker>
<datepicker :readonly="true" format="MMM/D/YYYY" name="date3"></datepicker>
</div>
</template>
<script>
import datepicker from 'vue-date-picker'
export default {
components: {
datepicker
}
}
</script>
Struts (Prop)
Prop | Type | Default | Description |
---|---|---|---|
value | String | -- | Date value of the datepicker |
name | String | -- | Input name property |
format | String | YYYY-MM-DD | Date formatting string |
readonly | String | false | Input readonly property |
input-class | Array|Object | -- | Binding class for input |
input-style | Array|Object | -- | Binding inline style for input |
Struts | 类型 | 默认 | 描述 |
---|---|---|---|
值 | 串 | - | 日期选择器的日期值 |
名称 | 串 | - | 输入名称属性 |
格式 | 串 | YYYY-MM-DD | 日期格式字符串 |
只读 | 串 | 假 | 输入只读属性 |
输入类 | 数组|对象 | - | 输入的绑定类 |
输入样式 | 数组|对象 | - | 绑定内联样式以进行输入 |
翻译自: https://vuejsexamples.com/datepicker-component-for-vue-2/