feat(tabbar): 更新底部导航栏配置和国际化文本
- 在 pages.json 中添加 icon 和 iconType 字段 - 将 tabbarList.ts 中的文本改为国际化占位符 - 在 about.vue 页面添加跳转到国际化页面的按钮
This commit is contained in:
parent
b154a44987
commit
28f38ce122
7770
pnpm-lock.yaml
generated
7770
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@ export const tabbarList = [
|
||||
iconPath: 'static/tabbar/home.png',
|
||||
selectedIconPath: 'static/tabbar/homeHL.png',
|
||||
pagePath: 'pages/index/index',
|
||||
text: '首页',
|
||||
text: '%tabbar.home%',
|
||||
icon: 'home',
|
||||
iconType: 'wot',
|
||||
},
|
||||
@ -30,7 +30,7 @@ export const tabbarList = [
|
||||
iconPath: 'static/tabbar/example.png',
|
||||
selectedIconPath: 'static/tabbar/exampleHL.png',
|
||||
pagePath: 'pages/about/about',
|
||||
text: '关于',
|
||||
text: '%tabbar.about%',
|
||||
icon: 'i-carbon-code',
|
||||
// 注意 unocss 的图标需要在 页面上引入一下,或者配置到 unocss.config.ts 的 safelist 中
|
||||
iconType: 'unocss',
|
||||
|
@ -28,13 +28,17 @@
|
||||
"iconPath": "static/tabbar/home.png",
|
||||
"selectedIconPath": "static/tabbar/homeHL.png",
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "%tabbar.home%"
|
||||
"text": "首页",
|
||||
"icon": "home",
|
||||
"iconType": "wot"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/tabbar/example.png",
|
||||
"selectedIconPath": "static/tabbar/exampleHL.png",
|
||||
"pagePath": "pages/about/about",
|
||||
"text": "%tabbar.about%"
|
||||
"text": "关于",
|
||||
"icon": "i-carbon-code",
|
||||
"iconType": "unocss"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -8,7 +8,7 @@
|
||||
</route>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="py-3">
|
||||
<view
|
||||
class="bg-white overflow-hidden pt-2 px-4"
|
||||
:style="{ marginTop: safeAreaInsets?.top + 'px' }"
|
||||
@ -22,8 +22,9 @@
|
||||
<RequestComp />
|
||||
<UploadComp />
|
||||
</view>
|
||||
<RequestComp />
|
||||
<UploadComp />
|
||||
<view class="text-center">
|
||||
<wd-button @click="gotoI18nPage()">去I18n页面</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -39,6 +40,12 @@ const toSubPage = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const gotoI18nPage = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/about/i18n',
|
||||
})
|
||||
}
|
||||
|
||||
// 奇怪:同样的代码放在 vue 里面不会校验到错误,放在 .ts 文件里面会校验到错误
|
||||
// const testOxlint = (name: string) => {
|
||||
// console.log('oxlint')
|
||||
|
Loading…
x
Reference in New Issue
Block a user