Answer the question
In order to leave comments, you need to log in
How to add Vue.js component to laravel blade template without app.js?
There is a vue.js component that I use only on one page of the application. I want to cut it out of app.js and add it separately only on this page. I was able to add, but an error arrives from app.js:
[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
<div id="app1">
<demo></demo>
</div>
export { Demo }
let Demo = {
name: 'demo',
data: function () {
return {
message: 'This is a local components.'
};
},
template: '<h1>Component: {{ message }}</h1>'
}
import { Demo } from './demo.js';
export default {
components: {
'demo': Demo
},
}
let demo = new Vue({
el: '#app1',
components: {
'demo': Demo
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question