UNPKG

i18n-zzz

Version:
56 lines (51 loc) 1.21 kB
import loader from './lib/vue-http-loader/index.js' const app = { keys: {}, target: null, filter: null, targetKey: null, langKeys: null, setup: false, langOptions: [], serviceOptions: [], tText: '', tResult: '', tSource: 'zh-TW', tTarget: 'en', configs: { gcpKey: localStorage.getItem('GCPKEY') || '', contentPrefixName: 'module.exports = ', mainLang: 'zh-TW', secLang: 'en', service: 'gcp' } } axios.get('./langOptions').then(({ data }) => { app.langOptions = data }) axios.get('./serviceOptions').then(({ data }) => { app.serviceOptions = data }) loader.addComponentFileFor('./components/', { 'btn': 'btn.vue', 'icon': 'icon.vue', 'app-nav': 'nav.vue', 'app-main': 'main.vue', 'app-toolbar': 'toolbar.vue', 'app-setting': 'setting.vue' }) loader.onload((components) => { for (var key in components) { Vue.component(key, components[key]) } Vue.mixin({ data() { return { app } } }) window.system = new Vue({ el: '#app' }) })