import _Vue, { PluginFunction } from 'vue'; import ApiService from '@/services/ApiService'; const ApiPlugin = { install: (Vue: typeof _Vue, options?: any) => { let apiService = new ApiService(); Vue.mixin({ created() { Vue.prototype.$api = apiService; } }) } } export default ApiPlugin;