feat(DatetimePicker): add readonly prop (#7107)

This commit is contained in:
neverland 2020-09-05 06:59:02 +08:00 committed by GitHub
parent da193d0b71
commit 07f0b1b637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -256,6 +256,7 @@ export default {
| cancel-button-text | Text of cancel button | _string_ | `Cancel` |
| show-toolbar | Whether to show toolbar | _boolean_ | `true` |
| loading | Whether to show loading prompt | _boolean_ | `false` |
| readonly `v2.10.5` | Whether to be readonly | _boolean_ | `false` |
| filter | Option filter | _(type, vals) => vals_ | - |
| formatter | Option text formatter | _(type, val) => val_ | - |
| columns-order `v2.9.2` | Array for ordering columns, where item can be set to<br> `year`, `month`, `day`, `hour` and `minute` | _string[]_ | - |

View File

@ -265,6 +265,7 @@ export default {
| cancel-button-text | 取消按钮文字 | _string_ | `取消` |
| show-toolbar | 是否显示顶部栏 | _boolean_ | `true` |
| loading | 是否显示加载状态 | _boolean_ | `false` |
| readonly `v2.10.5` | 是否为只读状态,只读状态下无法切换选项 | _boolean_ | `false` |
| filter | 选项过滤函数 | _(type, vals) => vals_ | - |
| formatter | 选项格式化函数 | _(type, val) => val_ | - |
| columns-order `v2.9.2` | 自定义列排序数组, 子项可选值为<br> `year``month``day``hour``minute` | _string[]_ | - |

View File

@ -7,6 +7,7 @@ export const sharedProps = {
...pickerProps,
value: null,
filter: Function,
columnsOrder: Array,
showToolbar: {
type: Boolean,
default: true,
@ -15,7 +16,6 @@ export const sharedProps = {
type: Function,
default: (type, value) => value,
},
columnsOrder: Array,
};
export const TimePickerMixin = {
@ -94,6 +94,7 @@ export const TimePickerMixin = {
<Picker
ref="picker"
columns={this.columns}
readonly={this.readonly}
onChange={this.onChange}
onConfirm={this.onConfirm}
onCancel={this.onCancel}