Where to register vue component? #6865
Unanswered
sander-vth
asked this question in
Q&A
Replies: 1 comment
-
I'm experiencing the same issue, the Vue component is showing up in dev tools but it will not render out on the page. I think it is because we are using Vue 3 elsewhere so the component is being compiled down to 3 when the CP uses 2. Still figuring out how to using Vue 2 and 3 at the same time in Vite. No luck so far. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am new to Statamic.
I would like to register a Vue component.
But I'm unsure on where and how?
I have
`import MyComponent from './components/Listing';
Statamic.booting(() => {
Statamic.$components.register('sample-listing', MyComponent );
});
`
I have put this in public/vendor/app/js/cp.js.
And my vue file is in public/vendor/app/js/components/Listing.vue
This file gets loaded, but I'm unable to use [sample-listing] in my view files.
What step(s) am I missing?
Beta Was this translation helpful? Give feedback.
All reactions