xhbilingual

1.引入注册指令

Usage no npm install needed!

<script type="module">
  import xhbilingual from 'https://cdn.skypack.dev/xhbilingual';
</script>

README

双语化 plugin

使用

1.引入注册指令

// src/views/main.js
import Translation from '@/assets/plugin/translation';

// 指令注册
Vue.use(Translation, {
    targetNode: document.body,
    targetLang: 'zh'
});

2.注册参数 | 参数 | 解释 | 默认值 | | ---- | ---- | ---- | | targetNode | 监听dom 范围 | document.body | | targetLang | 目标语言 | 'zh' | | translationUrl | 翻译接口 | ... |

3.使用方法

Vue.$reduceToChinese;
Vue.$translateIntoEnglish;

暂时支出语言种类

中文 ====>>> 'zh',
英文 ====>>> 'en'