1.1.1 • Published 2 years ago
vue-year-picker v1.1.1
vue-year-picker
仿ant风格年份选择器
使用方法
1. 安装
npm install --save vue-year-pickerimport Vue from 'vue';
import yearPicker from 'vue-year-picker'
Vue.use(yearPicker);2. 组件中使用
<year-picker
dark
v-model="year"
:year-disable="'no'"
@input="handlerInput"
/>export default {
name: 'demo',
data() {
return {
year: ''
}
},
methods: {
handlerInput(v) {
console.log('选中的年份',v)
}
}
}3.Attributes
| 参数 | 类型 | 描述 |
|---|---|---|
| dark | Boolean | 默认false,设置为true时开启深色模式 |
| year-disable | String | 'after'=禁用今年以后,'before'=禁用今年以前 |
4.Events
| 事件名 | 说明 | 参数 |
|---|---|---|
| input | 当用户选中年份时触发 | value |
