Skip to content

Commit

Permalink
fix: fix install component
Browse files Browse the repository at this point in the history
  • Loading branch information
guastallaigor committed Jun 3, 2021
1 parent c1b68f9 commit 6fc06fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -23,6 +23,4 @@ if (GlobalVue) {
GlobalVue.use(plugin)
}

VueTestimonials.install = installFunction

export default VueTestimonials
export default { install }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 6fc06fc

Please sign in to comment.