更新记录
1.0.2(2024-12-17) 下载此版本
更新使用文档,添加插槽说明
1.0.0(2024-12-17) 下载此版本
完成自适应导航栏对机型的适配
平台兼容性
uni-app
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| × | √ | - | - | × | × | - | - | - |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|
| √ | - | - | - | - | - | - | - | - | × | × |
使用说明
props
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| isFixed | Boolean | true | 是否吸顶 |
| bg | String | "#fff" | 背景颜色 |
| showLine | Boolean | true | 是否显示底部下划线 |
| isTest | Boolean | false | 测试用的,可观察是否适配机型 |
插槽
具名插槽box,只能通过该插槽设置导航栏
使用demo
通过easycom导入
{
"easycom": {
"autoscan": true,
"custom": {
"^my-(.*)": "@/uni_modules/components/my-$1/my-$1.vue"
}
},
"pages":[
//你的页面配置
]
}
组件目录创建
在根目录下创建components/my-nav/my-nav.vue
使用组件
<template>
<my-nav :isTest="true">
<template #box>
<view class="box">
<view class="nav-left">左边</view>
<view class="title">标题</view>
</view>
</template>
</my-nav>
</template>
<script setup>
import {ref} from "vue"
let bg=ref('#e6b4b4')
</script>
<style lang="scss" scoped>
.box{
width: 750rpx;
display: flex;
justify-content: center;
align-items: center;
.nav-left{
position: absolute;
left: 36rpx;
}
.nav-right{
width: 40px;
height: 40px;
background: red;
margin-left: 25rpx;
}
}
</style>

收藏人数:
下载插件并导入HBuilderX
赞赏(0)
下载 49
赞赏 0
下载 11013904
赞赏 1800
赞赏
京公网安备:11010802035340号