-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load vue-konva via dynamic import #164
Comments
We have a similar request! Per component import could greatly improve our app loading performance. |
Would definitely like to see individual component imports. Global component registration via plugins (how things are currently working) is a useful pattern when folks are just getting started with vue, but it is definitely not the recommended way of doing things, especially when you add typescript into the mix. |
I'd like to use vue-konva to create webcomponents which can easily be used in foreign code. <script lang="ts">
import UseKonva from "vue-konva";
let components = {} as { [key: string]: any };
UseKonva.install({
component(key: string, component: any) {
components[key] = component;
},
});
export default {
components,
};
</script> |
Based on the @mineichen comment. If you want to dynamically import VueKonva without using Vue.use(VueKonva), then this code can help you. Add this to the separate file:
In the vue file, add components row:
You have to add components row to each vue file that uses VueKonva components |
I am using vue-konva in a certain CMS Component. To keep my main bundle small, I would like to only load vue-konva (and konva) via dynamic import within my cms component, if that component is actually rendered on a certain page.
The problem is, that the call
Vue.use(VueKonva);
can only be done in the main app.It would be great, if
vue-konva
would offer a component based import option to do something like this:The text was updated successfully, but these errors were encountered: