1.多语言

2023.11.23周四--sws
master
sws 2023-11-23 16:35:13 +08:00
parent 4d9c36c3d7
commit 2b35c13907
5 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
module.exports = {
entry: ['locales'], // 提取、还原、遗漏扫描入口文件夹,可以配置多个,默认是 src
outDir: 'locales', // i18n 输出文件夹 默认是 src/locales
entry: [''], // 提取、还原、遗漏扫描入口文件夹,可以配置多个,默认是 src
outDir: 'lang', // i18n 输出文件夹 默认是 src/locales
outShow:2, //输出文件展示结构 1 扁平化结构 2树级结构 默认扁平化
exclude: ['locales'], // 不提取的文件夹, 默认是 ['src/locales']
exclude: ['lang'], // 不提取的文件夹, 默认是 ['src/locales']
extensions: ['.vue', '.js', '.ts'], // 提取的文件后缀名,默认是 ['.js', '.vue', '.ts']
filename: 'zh', // 输出的文件名,默认为 zh_cn
extname: 'json', // 输出的文件后缀名默认为 js ,支持json和jsjs格式为 module.exports = {} 或 export default {}

View File

@ -6,7 +6,7 @@ import base from './common/js/common/base';
import share from './common/js/common/share';
// 多语言引入并初始化
import messages from './locales/index'
import messages from './lang/index'
import VueI18n from 'vue-i18n';
let i18nConfig = {
locale: uni.getLocale() || 'zh',