vue.js城市选择框组件
每月选票 (vue-monthly-picker)
Vue Monthly Picker Components.
Vue每月选择器组件。
安装 (Install)
npm install vue-monthly-picker --save
import VueMonthlyPicker from 'vue-monthly-picker'
Vue.component('my-component', {
components: {
VueMonthlyPicker
}
});
用法 (Usage)
<vue-monthly-picker
v-model="selectedMonth">
</vue-monthly-picker>
可用道具 (Available props)
Prop | Type | Default | Description |
---|---|---|---|
disabled | Boolean | false | Enable/disable component |
monthLabels | Array | ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] | Customize month labels |
placeHolder | String | '' | Place holder when value is null |
min | moment | null | Minimum time to select |
max | moment | null | Maximum time to select |
dateFormat | String | YYYY/MM | Display format. |
Struts | 类型 | 默认 | 描述 |
---|---|---|---|
残障人士 | 布尔型 | false | 启用/禁用组件 |
monthLabels | 数组 | ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] | 自定义月份标签 |
placeHolder | 串 | '' | 值为空时的占位符 |
分 | 时刻 | null | 最短选择时间 |
最高 | 时刻 | null | 选择的最长时间 |
日期格式 | 串 | YYYY/MM | 显示格式。 |
大事记 (Events)
Event | Params | Description |
---|---|---|
selected | selected month in moment | A month has been selected |
事件 | 参数 | 描述 |
---|---|---|
已选 | 在选定月份moment | 已选择一个月 |
构建设置 (Build Setup)
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
翻译自: https://vuejsexamples.com/vuejs-monthly-picker-component/
vue.js城市选择框组件