Skip to content

Expander-DEMO


vue

<fv-Expander>
    <div style="position: relative; height: 500px; background: black; transition: all 0.3s;"></div>
</fv-Expander>

Disabled Expander

vue
<fv-Expander :disabledExpander="true">
    <div style="position: relative; height: 500px; background: black; transition: all 0.3s;"></div>
</fv-Expander>

Extension

vue
<fv-Expander :disabledExpander="true">
    <template v-slot:extension>
        <fv-button>Operation</fv-button>
    </template>
</fv-Expander>

Expander-Customize Background


vue
<fv-Expander background="rgba(0, 98, 158, 1)">
    <div style="position: relative; height: 500px; background: black; transition: all 0.3s;"></div>
</fv-Expander>

Expander-Dark Theme


vue
<fv-Expander theme="dark">
    <div style="position: relative; height: 500px; background: whitesmoke; transition: all 0.3s;"></div>
</fv-Expander>

Propoties


属性(attr)类型(type)必填(required)默认值(default)说明(statement)
valueBooleanNofalse是否展开 Expander
iconStringNoExpanderMenuIcon with Fabric-Icon
titleStringNoTitle of Expander.标题
contentStringNoContent information of Expander.副标题信息
titleBackground[string(color)]NoN/A客制化 Expander 背景
expandBackground[string(color)]NoN/A客制化 Expander 背景
defaultHeightNumberNo70默认高度
maxHeightNumberNo300展开最大高度
disabledExpanderBooleanNofalse禁用展开 Expander
visibleOverflowBooleanNotrue在禁用展开 Expander , 允许overflow内容显示
themeStringNosystem主题样式, 包含light, dark, system, custom几种样式

Events


事件名(Name)参数类型(args)说明(statement)
item-clickboolean返回 Expander 属性 value 的值
descrption-clickN/A描述框点击
icon-clickN/A右侧图标点击

Slot


  1. Default

定义下拉内容

vue
<fv-Expander background="rgba(0, 98, 158, 1)">
    <div style="position: relative; height: 500px; background: black; transition: all 0.3s;"></div>
</fv-Expander>
  1. content

自定义内容

  • title: 标题
  • contnet: 副标题
vue
<template v-slot:content="x">
    <div class="expander-title">{{ x.title }}</div>
    <div class="expander-info">{{ x.content }}</div>
</template>
  1. Extension

扩展操作内容

vue
<template v-slot:extension>
    <fv-button>Operation</fv-button>
</template>
  1. expand-icon

自定义展开状态图标

  • value: 当前是否展开
  • disabledCollaspe: 是否禁用展开
vue
<template v-slot:expand-icon="x">
    <i
        v-show="x.value"
        class="ms-Icon ms-Icon--ChevronUpMed"
    ></i>
    <i
        v-show="!x.value && !x.disabledExpander"
        class="ms-Icon ms-Icon--ChevronDownMed"
    ></i>
    <i
        v-show="!x.value && x.disabledExpander"
        class="ms-Icon ms-Icon--ChevronRightMed"
    ></i>
</template>

MIT Licensed