Import\Create custom VueJS component to the view file!
-
I want to create my Vue component and display it on the page, but I can't do it.
First of all, I added example.vue file to the:/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/example.vue
.
Then in the file:packages/Webkul/Velocity/src/Resources/assets/js/app.js
I added next linesimport VueExample from 'example-component';
Vue.use(VueExample);
Vue.component('example-component', require('./UI/components/example'));
In the view file:
resources/themes/velocity/views/products/view.blade.php
, I added<example-component></example-component>
but nothing happens.
This is the first time I do it) How can I add this component? -
Hi @Serhii,
Did you compile your assets?