Skip to content

ActionBar 动作栏

用于为页面相关操作提供便捷交互。

基础用法

徽标提示

自定义颜色

API

ActionBar Props

参数说明类型默认值
safe-area-inset-bottom是否开启底部安全区适配booleantrue
placeholder是否在标签位置生成一个等高的占位元素booleanfalse

ActionBarIcon Props

参数说明类型默认值
text按钮文字string-
icon图标string-
color图标颜色string#323233
icon-class图标额外类名string | Array | object-
icon-prefix图标类名前缀,等同于 Icon 组件的 class-prefix 属性stringr-icon
dot是否显示图标右上角小红点booleanfalse
badge图标右上角徽标的内容number | string-
badge-props自定义徽标的属性,传入的对象会被透传给 Badge 组件的 propsBadgeProps-
url点击后跳转的链接地址string-
to点击后跳转的目标路由对象,等同于 Vue Router 的 to 属性string | object-
replace是否在跳转时替换当前页面历史booleanfalse

ActionBarButton Props

参数说明类型默认值
text按钮文字string-
type按钮类型,可选值为 default primary success warning dangerstringdefault
color按钮颜色,支持传入 linear-gradient 渐变色string-
icon左侧图标名称或图片链接,等同于 Icon 组件的 name 属性string-
disabled是否禁用按钮booleanfalse
loading是否显示为加载状态booleanfalse
url点击后跳转的链接地址string-
to点击后跳转的目标路由对象,等同于 Vue Router 的 to 属性string | object-
replace是否在跳转时替换当前页面历史booleanfalse

ActionBarIcon Slots

名称说明
default文本内容
icon自定义图标

ActionBarButton Slots

名称说明
default按钮显示内容

类型定义

组件导出以下类型定义:

ts
import type {
  ActionBarProps,
  ActionBarIconProps,
  ActionBarButtonProps
} from 'ryxon'

主题定制

样式变量

组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 组件

名称默认值描述
--r-action-bar-backgroundvar(--r-background-2)-
--r-action-bar-height50px-
--r-action-bar-icon-width48px-
--r-action-bar-icon-height100%-
--r-action-bar-icon-colorvar(--r-text-color)-
--r-action-bar-icon-size18px-
--r-action-bar-icon-font-sizevar(--r-font-size-xs)-
--r-action-bar-icon-active-colorvar(--r-active-color)-
--r-action-bar-icon-text-colorvar(--r-text-color)-
--r-action-bar-icon-backgroundvar(--r-background-2)-
--r-action-bar-button-height40px-

Released under the MIT License.