更新记录
1.1.1(2026-07-19)
下载此版本
1.凸起优化
1.1.0(2026-07-17)
下载此版本
- 中间项新增
iconOnly 与 circleBackground 两种可配置样式
- 支持
centerIcon、activeCenterIcon 及独立图标尺寸
- 支持配置中间按钮圆形背景色和内边距
- 圆形背景模式统一外圆边框和内部背景颜色,并优化阴影扩散效果
- 示例使用
iconOnly 展示纯圆形人物图片
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,
centerVariant: 'iconOnly',
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: 80,
compactCenterTop: 76,
itemTopPadding: 78,
itemSpacing: 12,
itemIconSize: 46,
activeItemIconSize: 46,
centerSelectedSize: 112,
centerUnselectedSize: 112,
centerLabelSpacing: 12,
topY: 31,
shoulderWidth: 22,
crestWidth: 96,
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 |
标记为中间凸起项 |
centerVariant |
中间按钮样式。iconOnly 为纯图标/纯圆形图片,circleBackground 为圆形背景加中心内容,默认 circleBackground |
centerImage |
中间项图片,使用 aspectFill 裁剪为圆形 |
centerIcon |
中间项默认图标图片路径 |
activeCenterIcon |
中间项激活图标图片路径 |
centerIconSize |
中间项默认图标尺寸,单位 rpx |
activeCenterIconSize |
中间项激活图标尺寸,单位 rpx |
centerButtonColor |
当前中间项的圆形背景和边框颜色,优先于 theme.centerButtonColor |
centerButtonPadding |
当前中间项的圆形背景内边距,单位 rpx |
centerText |
中间项没有图片时的回退文本 |
centerSize |
中间项默认尺寸 |
activeCenterSize |
中间项激活尺寸 |
disabled |
是否禁用 |
layout 常用参数
| 参数 |
说明 |
barHeight / compactBarHeight |
普通屏 / 窄屏总高度 |
barTop / compactBarTop |
背景浮层顶部偏移 |
shellHeight / compactShellHeight |
白色底条可视高度 |
centerGap / compactCenterGap |
中间留白宽度 |
centerTop / compactCenterTop |
普通屏 / 窄屏中间按钮顶部位置 |
itemTopPadding |
普通项顶部内边距 |
itemSpacing |
图标和文字间距 |
centerSelectedSize / centerUnselectedSize |
中间按钮尺寸 |
centerButtonPadding |
圆形背景的默认内边距 |
centerIconSize / activeCenterIconSize |
中间图标的默认尺寸 |
centerLabelSpacing |
中间按钮文案和头像的垂直间距修正 |
topY |
曲线平直部分的基线 Y |
shoulderWidth |
两侧抬升过渡宽度 |
crestWidth |
中间凸起宽度 |
crestHeight |
中间凸起高度 |
slopeLift |
肩部过渡松紧度 |
中间按钮样式
纯圆形图片不绘制额外圆底和阴影:
{
label: 'AI Travel',
isCenter: true,
centerVariant: 'iconOnly',
centerImage: '/static/ai-travel-avatar.png'
}
圆形背景加中心图标:
{
label: 'AI Travel',
isCenter: true,
centerVariant: 'circleBackground',
centerIcon: '/static/icons/ai-travel-outline.svg',
activeCenterIcon: '/static/icons/ai-travel-active.svg',
centerIconSize: 48,
centerButtonColor: '#EDF6FF',
centerButtonPadding: 18
}
圆形背景和边框统一使用 theme.centerButtonColor;阴影使用 theme.centerShadowColor、layout.centerShadowBlur 和 layout.centerShadowOffsetY。
事件
| 事件 |
说明 |
input |
v-model 风格索引回传 |
update:currentIndex |
当前索引更新 |
itemTap |
任意 item 点击 |
change |
索引变化时触发 |
centerTap |
中间项点击 |
说明
- 微信小程序下,底栏背景当前仍使用 SVG
background-image 方案
- 如果后续继续针对小程序渲染细节优化,优先调整的是背景层结构,而不是 tab 交互逻辑