在js文件中使用vue-i18n

在.Vue文件中可以直接使用$t方法调用,在js文件中需要把Vue-i18nimport进来,再调用

1
2
3
// 根据自己具体代码引入vue-i18n
import i18n from '@/lang'
i18n.tc('xxx.xxx')