diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000000000000000000000000000000000000..ad123b13f76b772858f7ea16568517861347ea00 --- /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 19cc590b60417cd9919eb2b8894727f0f2fecc8c..5cbd88a67bdcf50bad280d23de8b76b7b682da3a 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 e29a2d81b8d4782dd12752065b996dd7d813eebe..1d2588860cfc3239e748903d51d10108877fe1f5 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); } }, };