Skip to content

vue
<div style="position: relative; width: 100%; height: 800px; display: flex;">
    <fv-NavigationPanel></fv-NavigationPanel>
</div>

vue
<div style="position: relative; width: 100%; height: 800px; display: flex;">
    <fv-NavigationPanel expandMode="flyout"></fv-NavigationPanel>
</div>

vue
<div style="position: relative; width: 100%; height: 800px; display: flex;">
    <fv-NavigationPanel mobileDisplay="100000000" flyoutDisplay="500"></fv-NavigationPanel>
</div>

  1. Standard
vue
<fv-NavigationPanel theme="dark"></fv-NavigationPanel>
  1. Flyout
vue
<fv-NavigationPanel expandMode="flyout" theme="dark"></fv-NavigationPanel>
  1. Mobile
vue
<fv-NavigationPanel mobileDisplay="100000000" flyoutDisplay="500" theme="dark"></fv-NavigationPanel>

属性


属性类型必填默认值说明
titlestring'NavigationPanel'NavigationPanel 标题。
expandbooleantrue初始是否展开,可通过 v-model:expand / update:expand 同步状态。
expandModestring'relative'展开模式,可选普通占位展开或 flyout 浮动展开。
expandWidthnumber350展开宽度,单位为 px
expandDisplaynumber1024视口宽度大于该值时允许展开。
compactWidthnumber50收起宽度,单位为 px
flyoutDisplaynumber0视口宽度小于该值时启用浮动模式;若 expandMode="flyout" 则始终为浮动模式。
fullSizeDisplaynumber800视口宽度小于该值且展开时,面板宽度会切换为 100%
mobileDisplaynumber0视口宽度小于该值时启用移动端悬浮控制模式。
showBackbooleantrue是否显示返回按钮。
showSearchbooleantrue是否显示搜索区域。
settingTitlestring'Settings'设置项标题。
showSettingbooleantrue是否显示设置项。
backgroundstring''面板背景色。
mobileControlBackgroundstring''移动端悬浮控制区的背景色。
mobileControlAcrylicbooleanfalse是否为移动端悬浮控制区启用模糊亚克力效果。
mobileControlDirectionstring'column'移动端悬浮控制按钮的排列方向。
mobileControlLeftstring'0px'移动端悬浮控制区的 CSS left 值。
mobileControlTopstring'12px'移动端悬浮控制区的 CSS top 值。
zIndexstring/number''同时控制移动端悬浮控制区和 NavigationPanel 根节点的 CSS z-index 值。
themestring'global'主题样式。支持 globallightdarksystemcustom
showNavbooleantrue是否显示导航按钮。
disabledbooleanfalse是否禁用。
langstring"global"语言配置。

事件


事件名参数说明
setting-clickObject点击设置项时触发,返回 { event: MouseEvent }
update:expandboolean展开状态变化时同步外部 expand
expand-changeboolean展开状态变化时触发,并返回当前状态。
expand-clickboolean点击导航按钮切换展开状态时触发,并返回切换后的状态。
backMouseEvent点击返回按钮时触发。

插槽


  1. SearchBlock

自定义搜索区域内容,默认搜索框仅提供展示。

javascript
<template v-slot:searchBlock></template>
  1. NavIcon

自定义导航按钮区域内容,默认图标为 GlobalNavButton

javascript
<template v-slot:navIcon>
    <i class="ms-Icon ms-Icon--GlobalNavButton icon"></i>
</template>
  1. BackIcon

自定义返回按钮区域内容,默认图标为 Back

javascript
<template v-slot:backIcon>
    <i class="ms-Icon ms-Icon--Back icon"></i>
</template>
  1. Title

自定义标题区域内容,默认展示 title 属性值。

javascript
<template v-slot:title="{ show }">
    <p v-show="show" class="name title">{{ title }}</p>
</template>
  1. Panel

自定义面板主体内容。

javascript
<template v-slot:panel></template>
  1. Banner

自定义顶部 banner 区域内容,可用于 Logo 等。

javascript
<template v-slot:banner></template>
  1. Setting

自定义设置项区域内容。

vue
<template v-slot:setting>
    <fv-animated-icon
        v-show="showSetting"
        ref="setting"
        modelValue="bounceRotate"
        class="fv-nav-default-item"
        :hideContent="!thisExpand"
        style="width: calc(100% - 10px)"
        @click="settingClick({ event: $event })"
    >
        <i class="ms-Icon ms-Icon--Settings icon"></i>
        <template v-slot:content>
            <p class="name">{{ settingTitle }}</p>
        </template>
    </fv-animated-icon>
</template>
  1. Mask

自定义组件遮罩层内容,可用于全局加载态等场景。

vue
<fv-NavigationPanel>
    <template v-slot:mask>
        <div
            style="
                position: absolute;
                inset: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                background: rgba(0, 0, 0, 0.35);
                color: white;
                z-index: 10;
            "
        >
            加载中...
        </div>
    </template>
</fv-NavigationPanel>

Appendix


  1. 获取 NavigationPanelsetting 的 DOM 引用:
vue
<fv-NavigationPanel v-model="items" ref="nav"></fv-NavigationPanel>
let setting = this.$refs.nav.setting;

MIT Licensed