feat: 使用 tabbar layout + wot icon

This commit is contained in:
菲鸽 2024-05-11 09:41:33 +08:00
parent ee52ae132d
commit 4f6d271c28
4 changed files with 9 additions and 4 deletions

View File

@ -33,8 +33,9 @@ export default defineUniPages({
}, },
{ {
pagePath: 'pages/my/index', pagePath: 'pages/my/index',
icon: 'i-carbon-user-avatar', icon: 'user',
isUnocssIcon: true, // 经过验证发现unocss这样跨文件动态图标无法显示所以先用wot icon 吧
// isUnocssIcon: true,
text: '我的', text: '我的',
}, },
], ],

4
src/layouts/tabbar.vue Normal file
View File

@ -0,0 +1,4 @@
<template>
<slot />
<fg-tabbar />
</template>

View File

@ -1,6 +1,7 @@
<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page推荐使用json5更强大且允许注释 --> <!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page推荐使用json5更强大且允许注释 -->
<route lang="json5" type="home"> <route lang="json5" type="home">
{ {
layout: 'tabbar',
style: { style: {
navigationStyle: 'custom', navigationStyle: 'custom',
navigationBarTitleText: '首页', navigationBarTitleText: '首页',
@ -28,7 +29,6 @@
<text class="text-green-500">tabbar</text> <text class="text-green-500">tabbar</text>
</view> </view>
</view> </view>
<fg-tabbar />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@ -1,6 +1,6 @@
<route lang="json5" type="page"> <route lang="json5" type="page">
{ {
layout: 'default', layout: 'tabbar',
style: { style: {
navigationBarTitleText: '我的', navigationBarTitleText: '我的',
}, },