Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zys8119/zi18nz
vue翻译插件
https://github.com/zys8119/zi18nz
Last synced: 10 days ago
JSON representation
vue翻译插件
- Host: GitHub
- URL: https://github.com/zys8119/zi18nz
- Owner: zys8119
- Created: 2018-07-13T08:10:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-16T03:28:51.000Z (about 5 years ago)
- Last Synced: 2024-04-25T09:42:49.342Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zi18nZ [![npm](https://img.shields.io/badge/npm-Install-zys8119.svg?colorB=cb3837&style=flat-square)](https://www.npmjs.com/package/zi18nz) [![github](https://img.shields.io/badge/github-
-zys8119.svg?colorB=000000&style=flat-square)](https://github.com/zys8119/Zi18nZ)
>Vue 翻译插件
## 安装
```angular2html
npm i zi18nz
```
## 配置```angular2html
//国际化
import Zi18nZ from "zi18nz"
Vue.use(Zi18nZ)
```## 教程
>例子
```vue
{{$t("test")}}export default {
name: "Dome",
data(){
return {
//局部语言模板
$t_t:{
en:{
test:"test"
},
cn:{
test:"测试"
},
//....
}
}
},
mounted(){
//设置语言
this.action({
moduleName:'$t',
goods:'en'
});
//设置全局语言模板
//创建 @/langs/index.js 文件,配置文件
/*示例:index.js
export default {
en:{
//...
},
cn:{
//...
}
//....
}
*/
}
}```
###### 具体方法及配置请查看[源代码](https://github.com/zys8119/Zi18nZ/blob/master/index.js)