diff --git a/client/src/lib.ts b/client/src/lib.ts index ee5d2482..eaded52d 100644 --- a/client/src/lib.ts +++ b/client/src/lib.ts @@ -1,12 +1,13 @@ // accessor import { accessor as neko } from './store' - +import { PluginObject } from 'vue' // Plugins import Logger from './plugins/log' import Client from './plugins/neko' import Axios from './plugins/axios' import Swal from './plugins/swal' import Anime from './plugins/anime' +import { i18n } from './plugins/i18n' // Components import Connect from '~/components/connect.vue' @@ -21,6 +22,9 @@ import Header from '~/components/header.vue' const exportMixin = { computed: { + beforeCreate () { + console.log('Creating neko component', this) + }, $accessor() { return neko }, @@ -30,8 +34,16 @@ const exportMixin = { }, } +const plugini18n: PluginObject = { + install(Vue) { + Vue.prototype.i18n = i18n + Vue.prototype.$t = i18n.t.bind(i18n) + }, +} + function extend (component: any) { return component + .use(plugini18n) .use(Logger) .use(Axios) .use(Swal)