Revert "fix(i18n): 修复微信小程序国际化问题"

This reverts commit c970e7bee176d250c795f8147b5ef2e394b29f2a.
This commit is contained in:
菲鸽 2024-06-19 17:41:58 +08:00
parent 92da043dd2
commit b616ad6070
2 changed files with 0 additions and 27 deletions

View File

@ -1,25 +1,8 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { tabBar } from '@/pages.json'
onLaunch(() => {
console.log('App Launch')
// #ifdef MP-WEIXIN
const setTabbarText = () => {
const { t } = useI18n()
const tabbarTexts = tabBar.list.map((item) => item.text.replace(/(^%|%$)/g, ''))
tabbarTexts.forEach((transKey: string, index: number) => {
uni.setTabBarItem({
index,
text: t(transKey),
})
})
}
// fix api tabbar text
setTabbarText()
uni.onLocaleChange(setTabbarText)
// #endif
})
onShow(() => {
console.log('App Show')

View File

@ -44,16 +44,6 @@
<script lang="ts" setup>
import i18n, { t } from '@/locale/index'
import { testI18n } from '@/utils/i18n'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
onLoad(() => {
// #ifdef MP-WEIXIN
// fix api
uni.setNavigationBarTitle({ title: t('app.name') })
// #endif
})
const current = ref(uni.getLocale())
const user = { name: '张三', detail: { height: 178, weight: '75kg' } }