Skip to content

vue
<fv-menuFlyout v-model="value" :options="options" placeholder="Pick a option">
</fv-menuFlyout>

vue
<fv-menuFlyout v-model="value" :options="options" placeholder="Pick a option" disabled>
</fv-menuFlyout>

vue
<fv-menuFlyout v-model="value" :options="options" placeholder="Pick a option" theme="dark">
</fv-menuFlyout>

属性 ​


属性类型必填默认值说明
modelValueobject否() =>Combobox当前项绑定。
optionsarray否[]Combobox数据。
borderWidthnumber否1
placeholderstring否'menuFlyout'
borderRadiusstring否'3'
backgroundstring否''
choosenBackgroundstring否''
choosenSliderBackgroundstring否''
inputForegroundstring否''
inputBackgroundstring否''
titleForegroundstring否''
dropDownIconstring否'ChevronDown'
dropDownIconForegroundstring否''
menuWidthnumber否200
menuMaxHeightnumber否350
rootTriggerModestring否'click'外层触发方式,click 点击触发,enter 移动触发。
triggerModestring否'enter'内层触发方式,click 点击触发,enter 移动触发。
wrapperNodeany否null外层元素包括的滚动容器,如果要考虑滚动同步,则需要设置该属性。
revealBorderColorboolean否false
revealBackgroundColorboolean否false
mobileModeboolean否false是否开启移动端显示。
isBoxShadowboolean否true
disabledboolean否false
themestring否'global'主题样式。支持 global、light、dark、system 和 custom。
revealBorderboolean否true参见组件的 revealBorder 选项。
langstring否"global"参见组件的 lang 选项。

事件 ​


事件名参数说明
choose-itemvalue/objectCombobox choose item

插槽 ​


  1. Default

用户可自定义 MenuFlyout Item 内容

vue
<slot :item="item">
    {{valueTrigger(item.type) !== 'divider' ? valueTrigger(item.text) : ''}}
</slot>

用户自定义样式时, 包含以下可选属性

  • item: 当前组数据
vue
<template v-slot:default="x">
  <i>{{x.item.text}}</i>
</template>
  1. Input

用户可自定义 MenuFlyout Input 内容

  • switchStatus: 切换状态函数
vue
<slot name="input" :switch="switchStatus">
    <fv-text-box
        :model-value="computedValue"
        :placeholder="placeholder"
        :theme="$theme"
        readonly
        :background="inputBackground"
        :foreground="inputForeground"
        :border-radius="borderRadius"
        :icon="dropDownIcon"
        :icon-foreground="dropDownIconForeground"
        :reveal-background-color="revealBorderColor"
        :reveal-border-color="revealBackgroundColor"
        :reveal-border-width="borderWidth"
        :reveal-border="revealBorder"
        :is-box-shadow="isBoxShadow"
        :disabled="isDisabled"
        :cursor="'default'"
        @click="switchStatus"
        @mouseenter="switchStatus"
    ></fv-text-box>
</slot>

Data ​


  1. options
javascript
options = [{key: '', text: '', type: '', disabled: ''}]

//e.g.//

options: [
    { key: "fruitsHeader", text: "Fruits", type: "header" },
    { key: "apple", text: "Apple", children: [
        { key: "A", text: "A" },
        { key: "B", text: "B" },
        { key: "Apple C", text: "Apple C", children: [
            { key: "A", text: "A" },
            { key: "B", text: "B" },
            { key: "Apple C-C", text: "Apple C-C", children: [
                { key: "A", text: "A" },
                { key: "B", text: "B" },
                { key: "Apple C-C-C", text: "Apple C-C-C" }
            ] }
        ] }
    ] },
    { key: "banana", text: "Banana" },
    { key: "orange", text: "Orange", disabled: true },
    { key: "grape", text: "Grape", children: [
        { key: "A", text: "A" },
        { key: "B", text: "B" },
        { key: "C", text: "C" }
    ] },
    { key: "divider_1", text: "-", type: "divider" },
    { key: "vegetablesHeader", text: "Vegetables", type: "header" },
    { key: "broccoli", text: "Broccoli" },
    { key: "carrot", text: "Carrot" },
    { key: "lettuce", text: "Lettuce" }
]

其中 text, disabled, type属性支持函数式声明.

MIT Licensed