From 954c2e451141297e7e50f2dbb8904bc8721cb7fa Mon Sep 17 00:00:00 2001 From: Julian Leucker <leuckerj@gmail.com> Date: Mon, 20 Feb 2023 14:28:03 +0100 Subject: [PATCH] Fix plugin --- docs/.vuepress/enhanceApp.js | 11 +++++++++++ example/src/main.js | 4 ++++ src/index.js | 6 ++---- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 docs/.vuepress/enhanceApp.js diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000..ad123b1 --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,11 @@ +import plugin from "../../src/index.js" + +export default ({ + Vue, // the version of Vue being used in the VuePress app + options, // the options for the root Vue instance + router, // the router instance for the app + siteData, // site metadata + isServer // is this enhancement applied in server-rendering or client + }) => { + Vue.use(plugin); +} diff --git a/example/src/main.js b/example/src/main.js index 19cc590..5cbd88a 100644 --- a/example/src/main.js +++ b/example/src/main.js @@ -1,8 +1,12 @@ import Vue from "vue"; import App from "./App.vue"; +import plugin from "../../src/index.js"; + import "./assets/main.css"; +Vue.use(plugin); + new Vue({ render: (h) => h(App), }).$mount("#app"); diff --git a/src/index.js b/src/index.js index e29a2d8..1d25888 100644 --- a/src/index.js +++ b/src/index.js @@ -7,10 +7,8 @@ Vue.use(VueInteractJs); const plugin = { install(Vue) { for (const prop in components) { - if (components.hasOwn(prop)) { - const component = components[prop]; - Vue.component(component.name, component); - } + const component = components[prop]; + Vue.component(component.name, component); } }, }; -- GitLab