Question: Is it possible to load Vue component locally in 1 liquid file? #132
Answered
by
sergejcodes
albertpratomo
asked this question in
Q&A
-
I don't want to register all of my Vue components globally. Is it possible to register locally in 1 liquid file? |
Beta Was this translation helpful? Give feedback.
Answered by
sergejcodes
Nov 5, 2021
Replies: 1 comment
-
Wouldn't recommend it, this adds unnecessary complexity. If you want to do it anyway, you should probably try the modular approach described in the docs here. And register the components manually, something like this (in main.js): import './my-component.vue'
const createVueAppForMyComponent = () => {
const app = createApp({})
app.component('my-component', component)
return app
}
createVueAppForMyComponent().mount('#vue-for-my-component') <div id="vue-for-my-component"></div> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
albertpratomo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wouldn't recommend it, this adds unnecessary complexity.
If you want to do it anyway, you should probably try the modular approach described in the docs here. And register the components manually, something like this (in main.js):