更新记录

1.0.0(2026-07-05) 下载此版本

  • 初始化 RyanArcFloatNav 组件
  • 初始化 RyanArcFloatNavScaffold 页面脚手架组件
  • 支持中间上凸中心按钮布局
  • 支持左右 tab 分组与中间留白布局
  • 支持通过动态 SVG 生成顶部凸面背景
  • 支持普通导航项与中心导航项激活态
  • 支持主题颜色、尺寸、曲线参数自定义
  • 支持示例页面与静态图标资源
  • 补充 README 使用说明与参数文档

平台兼容性

uni-app(5.01)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - - -

uni-app x(5.13)

Chrome Safari Android iOS 鸿蒙 微信小程序
- - - - - -

其他

多语言 暗黑模式 宽屏模式
× ×

Ryan Arc Float Nav

一个适用于 uni-app 的中间上凸底部导航组件,包含:

  • RyanArcFloatNav
  • RyanArcFloatNavScaffold

特性

  • 中间单独凸起的 center item,支持头像图
  • 通过动态 SVG 生成顶部凸面背景
  • 内置 safe area 适配
  • 支持普通 tab 与中间 tab 的激活态
  • 附带和组件结构一致的示例页面

安装路径

uni_modules/ryan-arc-float-nav

组件引入

import RyanArcFloatNavScaffold from '../../uni_modules/ryan-arc-float-nav/components/ryan-arc-float-nav-scaffold/ryan-arc-float-nav-scaffold.vue'

基础用法

<template>
    <RyanArcFloatNavScaffold
        :items="items"
        :pages="pages"
        :current-index="currentIndex"
        :layout="layout"
        @change="handleChange"
    >
        <template #page="{ page }">
            <view>{{ page.title }}</view>
        </template>
    </RyanArcFloatNavScaffold>
</template>

<script>
import RyanArcFloatNavScaffold from '../../uni_modules/ryan-arc-float-nav/components/ryan-arc-float-nav-scaffold/ryan-arc-float-nav-scaffold.vue'

export default {
    components: {
        RyanArcFloatNavScaffold
    },
    data() {
        return {
            currentIndex: 2,
            items: [
                { label: 'Home', icon: '/static/icons/home-outline.svg', activeIcon: '/static/icons/home-active.svg' },
                { label: 'Car Life', icon: '/static/icons/car-outline.svg', activeIcon: '/static/icons/car-active.svg' },
                { label: 'AI Travel', isCenter: true, centerImage: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&w=400&q=80' },
                { label: 'Explore', icon: '/static/icons/explore-outline.svg', activeIcon: '/static/icons/explore-active.svg' },
                { label: 'Profile', icon: '/static/icons/profile-outline.svg', activeIcon: '/static/icons/profile-active.svg' }
            ],
            pages: [
                { title: 'Home' },
                { title: 'Car Life' },
                { title: 'AI Travel' },
                { title: 'Explore' },
                { title: 'Profile' }
            ],
            layout: {
                maxWidth: 0,
                barHeight: 254,
                compactBarHeight: 238,
                barTop: 58,
                compactBarTop: 54,
                shellHeight: 196,
                compactShellHeight: 184,
                centerGap: 208,
                compactCenterGap: 186,
                centerTop: 82,
                itemTopPadding: 78,
                itemSpacing: 12,
                itemIconSize: 46,
                activeItemIconSize: 46,
                centerSelectedSize: 92,
                centerUnselectedSize: 92,
                centerLabelSpacing: -5,
                topY: 31,
                shoulderWidth: 15,
                crestWidth: 82,
                crestHeight: 24,
                slopeLift: 1
            },
            theme: {
                backgroundColor: '#FFFFFF',
                selectedItemColor: '#1E88FF',
                unselectedItemColor: '#314A81'
            }
        }
    },
    methods: {
        handleChange({ index }) {
            this.currentIndex = index
        }
    }
}
</script>

RyanArcFloatNav Props

参数 类型 说明
items Array 全部导航项。建议至少 3 项,其中 1 项设置 isCenter: true
currentIndex / value Number 当前激活索引。
theme Object 颜色主题配置。
layout Object 尺寸、曲线、gap、center 位置配置。
shellInset Number 整体左右外边距,单位 rpx
bottomOffset Number 整体底部偏移量,单位 rpx
absolute Boolean 是否固定在页面底部。
adaptBottomSafeArea Boolean 是否自动适配底部安全区。

RyanArcFloatNavScaffold Props

参数 类型 说明
items Array 导航项数组。
pages Array 页面数据数组,当前索引会映射到 activePage
currentIndex / value Number 当前激活索引。
theme Object 传给底部导航的主题配置。
layout Object 传给底部导航的布局配置。
contentPaddingBottom Number 内容区底部预留空间,单位 rpx
shellInset Number 整体左右外边距,单位 rpx
bottomOffset Number 整体底部偏移量,单位 rpx
absoluteNavigation Boolean 是否使用固定底部导航。
adaptBottomSafeArea Boolean 是否为内容区叠加底部安全区。

items 字段

字段 说明
label 文本标签
icon 普通项默认图标
activeIcon 普通项激活图标
iconSize 普通项图标尺寸
activeIconSize 普通项激活图标尺寸
activeColor 激活文案颜色
inactiveColor 非激活文案颜色
filledSelection 普通项激活时是否显示圆形渐变底
selectionGradientStart 激活渐变起始色
selectionGradientEnd 激活渐变结束色
isCenter 标记为中间凸起项
centerImage 中间项图片
centerText 中间项没有图片时的回退文本
centerSize 中间项默认尺寸
activeCenterSize 中间项激活尺寸
disabled 是否禁用

layout 常用参数

参数 说明
barHeight / compactBarHeight 普通屏 / 窄屏总高度
barTop / compactBarTop 背景浮层顶部偏移
shellHeight / compactShellHeight 白色底条可视高度
centerGap / compactCenterGap 中间留白宽度
centerTop 中间按钮顶部位置
itemTopPadding 普通项顶部内边距
itemSpacing 图标和文字间距
centerSelectedSize / centerUnselectedSize 中间按钮尺寸
centerLabelSpacing 中间按钮文案和头像的垂直间距修正
topY 曲线平直部分的基线 Y
shoulderWidth 两侧抬升过渡宽度
crestWidth 中间凸起宽度
crestHeight 中间凸起高度
slopeLift 肩部过渡松紧度

事件

事件 说明
input v-model 风格索引回传
update:currentIndex 当前索引更新
itemTap 任意 item 点击
change 索引变化时触发
centerTap 中间项点击

说明

  • 微信小程序下,底栏背景当前仍使用 SVG background-image 方案
  • 如果后续继续针对小程序渲染细节优化,优先调整的是背景层结构,而不是 tab 交互逻辑

隐私、权限声明

1. 本插件需要申请的系统权限列表:

No additional permissions required.

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

No data collection.

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

No ads.

许可协议

MIT协议

暂无用户评论。