折叠

使用 Collapse 来存储内容。

基本用法

您可以展开多个面板

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

手风琴

手风琴模式下,一次只能展开一个面板

使用 accordion 属性激活手风琴模式。

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

自定义标题

除了使用 title 属性之外,您还可以使用命名槽自定义面板标题,这使得添加自定义内容,例如图标,可能。

TIP

从版本 2.9.10 开始,title 插槽提供了 isActive 属性,指示当前折叠项是否处于活动状态。

自定义图标 2.8.3

除了使用 icon 属性之外,您还可以使用命名槽自定义面板项的图标,这使得添加自定义内容。

Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

自定义图标位置2.9.10

使用 expand-icon-position 属性,您可以自定义图标位置。

expand icon position:
left

防止崩溃 2.9.11

设置before-collapse属性,如果返回false或者返回Promise然后被拒绝,将停止折叠。

before collapse return:
true
Consistency
Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.

折叠 API

折叠属性

名称描述类型默认
模型值 / v 模型当前活动面板,手风琴模式下类型为 string,否则为 array字符串 / 数组[]
手风琴是否激活手风琴模式布尔值
展开图标位置 2.9.10设置展开图标位置枚举
崩溃前 2.9.11before-collapse 钩子在折叠状态改变之前。如果返回 false 或返回 Promise 然后被拒绝,将停止折叠功能

崩溃事件

名称描述类型
改变当活动面板改变时触发,手风琴模式下参数类型为 string,否则为 array功能

折叠槽

名称描述子标签
默认自定义默认内容折叠项目

崩溃暴露

名称描述类型
活动名称当前活动的面板名称对象
设置活动名称设置活动面板名称功能

折叠项目 API

折叠项目属性

名称描述类型默认
名称面板唯一标识字符串 / 数字
标题小组标题字符串''
图标 2.8.3折叠项目的图标字符串 / 组件向右箭头
已禁用禁用折叠项布尔值

折叠物品槽

名称描述类型
默认折叠项目的内容
标题折叠项目标题的内容对象
图标 2.8.3折叠项目图标的内容对象

折叠项目暴露

名称描述类型
处于活动状态当前折叠项是否处于活动状态对象