mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
refactor(cascader): rename splitor prop to seperator
This commit is contained in:
parent
d8a064afc1
commit
08c21a332f
@ -27,7 +27,7 @@ filter
|
||||
|-|-|-|-|
|
||||
|options|`Array<CascaderOption>`|`null`||
|
||||
|value|`string \| number`|`null`||
|
||||
|placeholder|`string`|`Please Select`||
|
||||
|placeholder|`string`|`'Please Select'`||
|
||||
|multiple|`boolean`|`false`||
|
||||
|size|`'small' \| 'medium' \| 'large'`|`'medium'`||
|
||||
|filterable|`boolean`|`false`|Can't be `true` with `remote` prop at same time.|
|
||||
@ -37,7 +37,7 @@ filter
|
||||
|clearable|`boolean`|`false`||
|
||||
|remote|`boolean`|`false`||
|
||||
|on-load|`(option: CascaderOption, resolve: (children: Array<CascaderOption>) => void) => any`|`() => {}`|Callback when click at unloaded nodes. Pass resolved children to `resolve` function to set children of the node.|
|
||||
|splitor|`string`|`'/'`||
|
||||
|seperator|`string`|`'/'`||
|
||||
|filter|`(pattern: string, option: CascaderOption, path: Array<CascaderOption>) => boolean`|A string based filter.||
|
||||
|
||||
## Events
|
||||
|
@ -28,17 +28,17 @@ filter
|
||||
|-|-|-|-|
|
||||
|options|`Array<CascaderOption>`|`null`||
|
||||
|value|`string \| number`|`null`||
|
||||
|placeholder|`string`|`请选择`||
|
||||
|placeholder|`string`|`'请选择'`||
|
||||
|multiple|`boolean`|`false`||
|
||||
|size|`'small' \| 'medium' \| 'large'`|`'medium'`||
|
||||
|filterable|`boolean`|`false`|不能在和 `remote` prop 同时为 `true`|
|
||||
|filterable|`boolean`|`false`|不能和 `remote` 同时为 `true`|
|
||||
|disabled|`boolean`|`false`||
|
||||
|expand-trigger|`'click' \| 'hover'`|`'click'`||
|
||||
|leaf-only|`boolean`|`true`||
|
||||
|clearable|`boolean`|`false`||
|
||||
|remote|`boolean`|`false`||
|
||||
|on-load|`(option: CascaderOption, resolve: (children: Array<CascaderOption>) => void) => any`|`() => {}`|在点击未加载完成节点时的回调。把获得的子节点传入 `resolve` 函数来设定这个节点的子节点。|
|
||||
|splitor|`string`|`'/'`||
|
||||
|seperator|`string`|`'/'`||
|
||||
|filter|`(pattern: string, option: CascaderOption, path: Array<CascaderOption>) => boolean`|一个基于字符串的过滤算法||
|
||||
|
||||
## Events
|
||||
|
@ -36,7 +36,6 @@
|
||||
@delete-last-option="handleDeleteLastOption"
|
||||
@pattern-input="handlePatternInput"
|
||||
/>
|
||||
|
||||
<n-base-portal ref="portal1">
|
||||
<cascader-menu
|
||||
ref="menu1"
|
||||
@ -175,7 +174,7 @@ export default {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
},
|
||||
splitor: {
|
||||
seperator: {
|
||||
type: String,
|
||||
default: ' / '
|
||||
},
|
||||
@ -240,7 +239,7 @@ export default {
|
||||
if (values.has(option.value)) {
|
||||
options.push({
|
||||
value: option.value,
|
||||
label: path.slice(1, path.length).join(this.splitor)
|
||||
label: path.slice(1, path.length).join(this.seperator)
|
||||
})
|
||||
}
|
||||
}, () => {
|
||||
@ -265,7 +264,7 @@ export default {
|
||||
if (option.value === this.value) {
|
||||
selectedOption = {
|
||||
value: option.value,
|
||||
label: path.slice(1, path.length).join(this.splitor)
|
||||
label: path.slice(1, path.length).join(this.seperator)
|
||||
}
|
||||
}
|
||||
}, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user