项目中静态资源一般是放在json里面,因为很多语言都支持json,通过import的方式引入。 1、在 src/i18n 目录新增zh.json文件中, 添加如下代码
en.json
{
"name": "Epidemic prevention health code",
"loadingMsg": "Loading",
"bind": "To bind",
"updateTime": "UpdateTime",
"servicing": "Currently unavailable in server maintenance",
"outdateLine": "Login expired!",
"abnormal": "There is an exception",
"noabnormal": "No abnormality seen",
"noBindMes": "You are not identity bound in the National Government Platform fast application or binding expired."
}
在 src/demo/index目录新增zh.json文件中, 添加如下代码 2. 引入 import en from '../i18n/en.json'
3.使用,某些代码会省略
<text class="none-text">{{ en.servicing }}</text>
private: {
en,
zh,
},
|