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

45 lines
1.3 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
## 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-09-10 14:18:02 +08:00
|theme|`'light' \| 'dark' \| null \| string`|`null`||
2020-09-19 00:10:16 +08:00
|on-update-expanded-names|`(expandedNames: Array<string>) => any`|`() => {}`||
|on-item-header-click|`(data: { name: string, expanded: boolean, event: MouseEvent }) => any`|`() => {}`||
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|`()`||
2020-05-31 14:30:05 +08:00
|arrow|`(options: { collapsed: boolean })`||
2020-02-03 21:20:21 +08:00