From 6fc06fc16da7dceab48c94304395a692bda9f641 Mon Sep 17 00:00:00 2001 From: guastallaigor Date: Thu, 3 Jun 2021 19:44:54 -0300 Subject: [PATCH] fix: fix install component --- lib/index.ts | 10 ++++------ package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 7168e3e..7f886d4 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -3,16 +3,16 @@ import VueTestimonials from './component/VueTestimonials.vue' let installed = false -const installFunction = (Vue: App) => { +function install(Vue: App): void { if (installed) return installed = true Vue.component(VueTestimonials.name, VueTestimonials) } -const plugin = { install: installFunction } - let GlobalVue = null +const plugin = { install } + if (typeof window !== 'undefined') { GlobalVue = (window as any).Vue } else if (typeof global !== 'undefined') { @@ -23,6 +23,4 @@ if (GlobalVue) { GlobalVue.use(plugin) } -VueTestimonials.install = installFunction - -export default VueTestimonials +export default { install } diff --git a/package.json b/package.json index 447fd48..f4b0a0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-testimonials", - "version": "0.1.3", + "version": "0.1.4", "description": "Vue Testimonials is a Vue 3 testimonials component made with Vite and TypeScript", "homepage": "https://github.com/guastallaigor/vue-testimonials#readme", "author": {