基础用法
设置选择范围
通过range
字段配配置选择的范围
年份选择器 属性
属性名 | 说明 | 类型 | 默认值 |
---|---|---|---|
model-value / v-model | 绑定值 | Number / String / Array | — |
start-placeholder | 开始选择器的placeholder | String | — |
end-placeholder | 结束选择器的placeholder | String | — |
disabled | 禁用标志 | Boolean | — |
multiple | 范围选择的标志 | Boolean | true |
separator | 分隔符 | String / 组件 | 至 |
range | 选择的年份范围,会对传入的做校验,校验是否为年份 | Array | [1950, 至今] |
其他查询组件通用属性请查看查询组件通用
年份选择器 事件
事件名 | 说明 | 回调参数 |
---|---|---|
change | 选中值发生变化时触发 | (val:目前的选中值) |
change-select | select发生变化时触发 | (val:目前select的选中值, index: 触发的select的索引) |
visible-change | 下拉框出现/隐藏时触发 | (val:出现则为 true,隐藏则为 false, index: 触发的select的索引) |
blur | 当 input 失去焦点时触发 | (event: FocusEvent, index: 触发的select的索引) |
focus | 当 input 获得焦点时触发 | (event: FocusEvent, index: 触发的select的索引) |
年份选择器 插槽
插槽名 | 说明 |
---|---|
prefix | 选择器头部内容 |
suffix | 选择器尾部内容 |
separator | 选择器分隔符 |
年份选择器 Exposes
属性名 | 说明 | 类型 |
---|---|---|
ref | 选择器 select 元素数组,是范围就会是个数组,单年份就是返回单个元素ref对象 | [RefImpl, RefImpl] / RefImpl |
clearValue | 清空选择器的方法 | Function: () => void |
yearList | 选择器当前可选的年份数组 | RefImpl <Array> |