doc(cascader): zh-cn

This commit is contained in:
07akioni 2020-02-04 21:44:48 +08:00
parent f52389778b
commit 7516d5743e
11 changed files with 79 additions and 19 deletions

View File

@ -1,4 +1,6 @@
# Cascader
Cascader can be used to select some tree structured data.
## Demos
```demo
single-leaf-only
trigger
@ -14,4 +16,31 @@ multiple-leaf-only-lazy
single-lazy
multiple-lazy
filter
```
```
## V-model
|Prop|Event|
|-|-|
|value|change|
## Props
|Name|Type|Default|Description|
|-|-|-|-|
|options|`Array<CascaderOption>`|`null`||
|value|`string \| number`|Value should be unique in options.|
|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.|
|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) : {}`|`() => {}`|Callback when click at unloaded nodes. Pass resolved children to `resolve` function to set children of the node.|
|splitor|`string`|`'/'`||
|filter|`(pattern: string, option: CascaderOption, path: Array<CascaderOption>) : boolean`|A string based filter.||
## Events
|Name|Parameters|Description|
|-|-|-|
|change|`(value: string \| number \| Array<string \| number>)`

View File

@ -1,4 +1,4 @@
# Lazy Multiple
# Async Multiple
```html
<n-cascader
v-model="value"
@ -6,7 +6,7 @@
:leaf-only="false"
placeholder="Please Select Something"
:options="options"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,4 +1,4 @@
# Lazy Multiple (Leaf Only)
# Async Multiple (Leaf Only)
```html
<n-cascader
v-model="value"
@ -6,7 +6,7 @@
placeholder="Please Select Something"
:options="options"
style="flex-grow: 1; margin-right: 12px;"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,11 +1,11 @@
# Lazy Single
# Async Single
```html
<n-cascader
v-model="value"
placeholder="Please Select Something"
:options="options"
:leaf-only="false"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,9 +1,9 @@
# Lazy Single (Leaf Only)
# Async Single (Leaf Only)
```html
<n-cascader
v-model="value"
placeholder="Please Select Something"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,4 +1,6 @@
# 级联选择
# 级联选择 Cascader
用来选一些树型信息。
## 演示
```demo
single-leaf-only
trigger
@ -15,3 +17,31 @@ single-lazy
multiple-lazy
filter
```
## V-model
|Prop|Event|
|-|-|
|value|change|
## Props
|名称|类型|默认值|介绍|
|-|-|-|-|
|options|`Array<CascaderOption>`|`null`||
|value|`string \| number`|Value should be unique in options.|
|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.|
|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) : {}`|`() => {}`|Callback when click at unloaded nodes. Pass resolved children to `resolve` function to set children of the node.|
|splitor|`string`|`'/'`||
|filter|`(pattern: string, option: CascaderOption, path: Array<CascaderOption>) : boolean`|A string based filter.||
## Events
|名称|参数|介绍|
|-|-|-|
|change|`(value: string \| number \| Array<string \| number>)`

View File

@ -1,4 +1,4 @@
# 延迟多项
# 异步多项
```html
<n-cascader
v-model="value"
@ -6,7 +6,7 @@
:leaf-only="false"
placeholder="请选些什么"
:options="options"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,4 +1,4 @@
# 延迟多项(仅叶子节点)
# 异步多项(仅叶子节点)
```html
<n-cascader
v-model="value"
@ -6,7 +6,7 @@
placeholder="请选些什么"
:options="options"
style="flex-grow: 1; margin-right: 12px;"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,11 +1,11 @@
# 延迟单项
# 异步单项
```html
<n-cascader
v-model="value"
placeholder="请选些什么"
:options="options"
:leaf-only="false"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,9 +1,9 @@
# 延迟单项(仅叶子节点)
# 异步单项(仅叶子节点)
```html
<n-cascader
v-model="value"
placeholder="请选些什么"
lazy
remote
:on-load="handleLoad"
/>
```

View File

@ -1,4 +1,5 @@
# 触发
# 触发方式
可以是 `hover` 或者 `click`
```html
<n-cascader
v-model="value"