Skip to content

FoldingPanel 折叠面板组件

通过折叠面板收纳内容区域。

温馨提示

本项目参考了 uView-Plus 开源项目的组件开发方式,基于 Vue 3 和 TypeScript 实现了自定义组件。目前该组件仍处于测试阶段。
感谢 uView-Plus 开源项目及其团队成员的贡献,他们的组件开发思路为本项目提供了宝贵地参考。如果需要了解更多组件开发细节,可以参考uView-Plus的 collapse组件 的代码实现。

平台差异说明

APP(vue)H5微信小程序

基本使用示例

html
<!-- 全局使用 -->
<hy-folding-panel :list="columns" title="水果摊" :border="false">
    <template #default="{ record }">
        <view style="padding: 20px">
            {{ record }}
        </view>
    </template>
</hy-folding-panel>
<!-- 单个组件引入 -->
<HyFoldingPanel type="primary"></HyFoldingPanel>
ts
import { HyFoldingPanel } from "hy-app";

const columns = [
    {
        title: "苹果",
        desc: "apply",
        content: "我是内容"
    },
    {
        title: "香蕉",
        desc: "banana"
    },
    {
        title: "橙汁",
        desc: "org",
        error: true
    }
];

基本使用示例

html
<template>
    <hy-button text="月落"></hy-button>
</template>

API

参数说明类型默认值
list列表数据集array-
accordion是否手风琴模式booleanfalse
title头部标题string-
titleBorder是否显示头部底部边框booleanfalse
border是否显示cell下边框booleantrue
verticalColor标题前缀竖线颜色stringColorConfig.primary
showVertical是否显示标题前缀竖线booleantrue
disabled是否禁用booleanfalse
size单元的大小small|medium|largemedium
contentHeight内容面板高度string | number120
customStyle定义需要用到的外部样式CSSProperties-

list

参数说明类型默认值
spread是否展示boolean-
icon单元格左图标string-
title单元格标题string-
sub单元格副标题string-
disabled是否禁用单元格boolean-
rightIcon单元格右图标string-
value单元格值string-
url跳转页面地址string-
arrowDirection单元格右侧箭头的方向left|up|downleft
content展示面板里值string-

Events

事件名说明回调参数
change改成面板开关状态temp:list单条数据, index:索引
open打开面板temp:list单条数据, index:索引
close关闭面板temp:list单条数据, index:索引

Slots

插槽名说明接收值
default主体部分的内容record
icon单元格图标icon
title单元格标题内容title
value单元格右侧valuerecord
00:46