Skip to content

Navbar 导航栏

介绍

为页面提供导航功能,常用于页面顶部。

基础用法

通过 title 属性设置导航栏标题。

html
<vd-navbar title="标题" />

左侧箭头

通过 left-arrow 属性设置导航栏左侧箭头。

html
<vd-navbar title="标题" left-arrow />

左侧文案

通过 left-text 属性设置导航栏左侧文案。

html
<vd-navbar title="标题" left-text="返回" />

右侧文案

通过 right-text 属性设置导航栏右侧文案。

html
<vd-navbar title="标题" right-text="右侧" />

使用插槽

通过 leftright 插槽设置导航栏左侧和右侧内容。

html
<vd-navbar title="标题" left-arrow>
  <template #right>
    <vd-button type="primary" icon="search" link></vd-button>
  </template>
</vd-navbar>

禁用状态

通过 left-disabledright-disabled 属性设置导航栏左侧和右侧的禁用状态。

html
<vd-navbar
  title="标题"
  left-arrow
  left-text="返回"
  right-text="右侧"
  left-disabled
  right-disabled
/>

状态栏占位

通过 status-bar 属性设置状态栏占位。

html
<vd-navbar title="标题" status-bar />

API

Props

参数说明类型默认值
title标题string-
height高度string | number44
fixed是否固定在顶部booleantrue
placeholder固定在顶部时,是否启用占位元素booleantrue
left-arrow是否显示左侧箭头booleanfalse
left-text左侧文案string-
right-text右侧文案string-
left-disabled左侧是否禁用booleanfalse
right-disabled右侧是否禁用booleanfalse
status-bar是否状态栏占位booleanfalse
z-index层级string | number99

代替原始 Props

参数说明类型默认值
custom-id根节点idstring-
custom-class根节点类名ClassValue-
custom-style根节点样式StyleValue-

Events

事件名说明回调参数
click点击时触发MouseEvent
click-title标题点击时触发MouseEvent
click-left左侧点击时触发MouseEvent
click-right右侧点击时触发MouseEvent
resize尺寸改变时触发NodeRect

Slots

名称说明
default自定义内容
left左侧内容
right右侧内容

赣ICP备2025061025号-1