fix: `Cascader` `option.value` supports `String` `Number` type
parent
dfc46a0de7
commit
dbc0b2eaeb
|
@ -10,7 +10,7 @@
|
||||||
| allowClear | whether allow clear | boolean | true |
|
| allowClear | whether allow clear | boolean | true |
|
||||||
| autoFocus | get focus when component mounted | boolean | false |
|
| autoFocus | get focus when component mounted | boolean | false |
|
||||||
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
|
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false |
|
||||||
| defaultValue | initial selected value | string\[] | \[] |
|
| defaultValue | initial selected value | string\[] \| number\[] | \[] |
|
||||||
| disabled | whether disabled select | boolean | false |
|
| disabled | whether disabled select | boolean | false |
|
||||||
| displayRender | render function of displaying selected options, you can use slot="displayRender" and slot-scope="{labels, selectedOptions}" | `({labels, selectedOptions}) => vNode` | `labels => labels.join(' / ')` |
|
| displayRender | render function of displaying selected options, you can use slot="displayRender" and slot-scope="{labels, selectedOptions}" | `({labels, selectedOptions}) => vNode` | `labels => labels.join(' / ')` |
|
||||||
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
|
| expandTrigger | expand current item when click or hover, one of 'click' 'hover' | string | 'click' |
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
| showSearch | Whether show search input in single mode. | boolean\|object | false |
|
| showSearch | Whether show search input in single mode. | boolean\|object | false |
|
||||||
| size | input size, one of `large` `default` `small` | string | `default` |
|
| size | input size, one of `large` `default` `small` | string | `default` |
|
||||||
| suffixIcon | The custom suffix icon | string \| VNode \| slot | - |
|
| suffixIcon | The custom suffix icon | string \| VNode \| slot | - |
|
||||||
| value(v-model) | selected value | string\[] | - |
|
| value(v-model) | selected value | string\[] \| number\[] | - |
|
||||||
|
|
||||||
Fields in `showSearch`:
|
Fields in `showSearch`:
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ import { cloneElement } from '../_util/vnode';
|
||||||
import warning from '../_util/warning';
|
import warning from '../_util/warning';
|
||||||
|
|
||||||
const CascaderOptionType = PropTypes.shape({
|
const CascaderOptionType = PropTypes.shape({
|
||||||
value: PropTypes.string,
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
label: PropTypes.any,
|
label: PropTypes.any,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
children: PropTypes.array,
|
children: PropTypes.array,
|
||||||
key: PropTypes.string,
|
key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
}).loose;
|
}).loose;
|
||||||
|
|
||||||
const FieldNamesType = PropTypes.shape({
|
const FieldNamesType = PropTypes.shape({
|
||||||
|
@ -49,9 +49,9 @@ const CascaderProps = {
|
||||||
/** 可选项数据源 */
|
/** 可选项数据源 */
|
||||||
options: PropTypes.arrayOf(CascaderOptionType).def([]),
|
options: PropTypes.arrayOf(CascaderOptionType).def([]),
|
||||||
/** 默认的选中项 */
|
/** 默认的选中项 */
|
||||||
defaultValue: PropTypes.arrayOf(PropTypes.string),
|
defaultValue: PropTypes.array,
|
||||||
/** 指定选中项 */
|
/** 指定选中项 */
|
||||||
value: PropTypes.arrayOf(PropTypes.string),
|
value: PropTypes.array,
|
||||||
/** 选择完成后的回调 */
|
/** 选择完成后的回调 */
|
||||||
// onChange?: (value: string[], selectedOptions?: CascaderOptionType[]) => void;
|
// onChange?: (value: string[], selectedOptions?: CascaderOptionType[]) => void;
|
||||||
/** 选择后展示的渲染函数 */
|
/** 选择后展示的渲染函数 */
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
| allowClear | 是否支持清除 | boolean | true |
|
| allowClear | 是否支持清除 | boolean | true |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false |
|
| autoFocus | 自动获取焦点 | boolean | false |
|
||||||
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
|
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false |
|
||||||
| defaultValue | 默认的选中项 | string\[] | \[] |
|
| defaultValue | 默认的选中项 | string\[] \| number\[] | \[] |
|
||||||
| disabled | 禁用 | boolean | false |
|
| disabled | 禁用 | boolean | false |
|
||||||
| displayRender | 选择后展示的渲染函数,可使用slot="displayRender" 和 slot-scope="{labels, selectedOptions}" | `({labels, selectedOptions}) => vNode` | `labels => labels.join(' / ')` |
|
| displayRender | 选择后展示的渲染函数,可使用slot="displayRender" 和 slot-scope="{labels, selectedOptions}" | `({labels, selectedOptions}) => vNode` | `labels => labels.join(' / ')` |
|
||||||
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
|
| expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | 'click' |
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
| showSearch | 在选择框中显示搜索框 | boolean | false |
|
| showSearch | 在选择框中显示搜索框 | boolean | false |
|
||||||
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
|
| size | 输入框大小,可选 `large` `default` `small` | string | `default` |
|
||||||
| suffixIcon | 自定义的选择框后缀图标 | string \| VNode \| slot | - |
|
| suffixIcon | 自定义的选择框后缀图标 | string \| VNode \| slot | - |
|
||||||
| value(v-model) | 指定选中项 | string\[] | - |
|
| value(v-model) | 指定选中项 | string\[] \| number\[] | - |
|
||||||
|
|
||||||
`showSearch` 为对象时,其中的字段:
|
`showSearch` 为对象时,其中的字段:
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const menuProps = {
|
||||||
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
theme: PropTypes.oneOf(['light', 'dark']).def('light'),
|
||||||
mode: MenuMode.def('vertical'),
|
mode: MenuMode.def('vertical'),
|
||||||
selectable: PropTypes.bool,
|
selectable: PropTypes.bool,
|
||||||
selectedKeys: PropTypes.arrayOf(PropTypes.string),
|
selectedKeys: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
defaultSelectedKeys: PropTypes.array,
|
defaultSelectedKeys: PropTypes.array,
|
||||||
openKeys: PropTypes.array,
|
openKeys: PropTypes.array,
|
||||||
defaultOpenKeys: PropTypes.array,
|
defaultOpenKeys: PropTypes.array,
|
||||||
|
|
Loading…
Reference in New Issue