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
|
2020-04-28 22:07:06 +08:00
|
|
|
|
arrow-placement
|
2019-12-02 03:57:34 +08:00
|
|
|
|
accordion
|
|
|
|
|
nested
|
2020-05-28 13:08:59 +08:00
|
|
|
|
display-directive
|
2020-03-18 15:56:59 +08:00
|
|
|
|
item-header-click
|
2019-12-02 03:57:34 +08:00
|
|
|
|
```
|
2020-02-03 21:07:58 +08:00
|
|
|
|
## V-model
|
|
|
|
|
|Prop|Event|
|
|
|
|
|
|-|-|
|
2020-03-08 19:24:07 +08:00
|
|
|
|
|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`||
|
2020-04-28 22:07:06 +08:00
|
|
|
|
|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`|
|
2020-04-28 22:07:06 +08:00
|
|
|
|
|expanded-names|`Array<string \| number>`|`null`||
|
2020-05-30 17:20:27 +08:00
|
|
|
|
|theme|`'light' \| 'dark' \| null`|`null`||
|
2020-04-28 22:07:06 +08:00
|
|
|
|
|
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`||**必需**|
|
2020-04-28 22:07:06 +08:00
|
|
|
|
|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|`()`||
|
2020-03-18 15:56:59 +08:00
|
|
|
|
|header|`()`||
|
2020-04-28 22:07:06 +08:00
|
|
|
|
|arrow|`({ collapsed: boolean })`||
|
2020-02-03 21:20:21 +08:00
|
|
|
|
|
2020-02-03 21:07:58 +08:00
|
|
|
|
## Event
|
2020-03-18 16:54:08 +08:00
|
|
|
|
### Collapse Event
|
2020-02-07 23:40:07 +08:00
|
|
|
|
|名称|参数|说明|
|
2020-02-03 21:07:58 +08:00
|
|
|
|
|-|-|-|
|
2020-03-18 15:56:59 +08:00
|
|
|
|
|expanded-names-change|`(expandedNames: Array<string>)`||
|
|
|
|
|
|item-header-click|`({ name: string, expanded: boolean, event: MouseEvent })`||
|