naive-ui/demo/documentation/components/collapse/zhCN/index.md

54 lines
1.4 KiB
Markdown
Raw Normal View History

2020-02-03 21:20:21 +08:00
# 折叠面板 Collapse
2020-02-03 21:07:58 +08:00
我看到它总被用在界面边栏的控制面板上。
## 演示
2019-12-02 03:57:34 +08:00
```demo
basic
arrow-placement
2019-12-02 03:57:34 +08:00
accordion
nested
2020-05-28 13:08:59 +08:00
display-directive
item-header-click
2019-12-02 03:57:34 +08:00
```
2020-02-03 21:07:58 +08:00
## V-model
|Prop|Event|
|-|-|
|expanded-names|expanded-names-change|
2020-02-03 21:07:58 +08:00
## Props
### Collapse Props
2020-02-07 23:40:07 +08:00
|名称|类型|默认值|说明|
2020-02-03 21:07:58 +08:00
|-|-|-|-|
|accordion|`boolean`|`false`||
|arrow-placement|`'left' \| 'right'`|`'left'`||
2020-05-28 13:08:59 +08:00
|display-directive|`'if' \| 'show'`|`'if'`|内部 `n-collapse-item` 在控制内容是否渲染时使用的指令,`'if'` 对应 `v-if``'show'` 对应 `v-show`|
|expanded-names|`Array<string \| number>`|`null`||
2020-05-30 17:20:27 +08:00
|theme|`'light' \| 'dark' \| null`|`null`||
2020-02-03 21:07:58 +08:00
### Collapse Item Props
2020-02-07 23:40:07 +08:00
|名称|类型|默认值|说明|
2020-02-03 21:07:58 +08:00
|-|-|-|-|
2020-05-28 13:08:59 +08:00
|display-directive|`'if' \| 'show' \| null`|`null`|自身在控制内容是否渲染时使用的指令,`'if'` 对应 `v-if``'show'` 对应 `v-show`。在设定为 `null` 的时候跟随外层的 `n-collapse`|
2020-02-03 21:07:58 +08:00
|name|`string \| number`||**必需**|
|title|`string`|`null`||
2020-02-03 21:07:58 +08:00
2020-02-03 21:20:21 +08:00
## Slots
### Collapse Slots
2020-02-07 23:40:07 +08:00
|名称|参数|说明|
2020-02-03 21:20:21 +08:00
|-|-|-|
|default|`()`||
### Collapse Item Slots
2020-02-07 23:40:07 +08:00
|名称|参数|说明|
2020-02-03 21:20:21 +08:00
|-|-|-|
|default|`()`||
|header|`()`||
|arrow|`({ collapsed: boolean })`||
2020-02-03 21:20:21 +08:00
2020-02-03 21:07:58 +08:00
## Event
### Collapse Event
2020-02-07 23:40:07 +08:00
|名称|参数|说明|
2020-02-03 21:07:58 +08:00
|-|-|-|
|expanded-names-change|`(expandedNames: Array<string>)`||
|item-header-click|`({ name: string, expanded: boolean, event: MouseEvent })`||