Flex
223
5
Laravel

Not working Laravel + Vuejs in laravel app

Posted 2 months ago by Flex

working with Laravel 5.7 and Vue Js. this is app.js

let Myheader = require('./components/Myheader.vue');
let Myfooter = require('./components/Myfooter.vue');

const app = new Vue({
    el: '#app',
    components:{Myheader,Myfooter}
});

blade.php file

<body>
<div id="app">
<Myheader></Myheader>
<Myfooter></Myfooter>
</div>
<script src="{{ asset('js/app.js')}}"></script>  
</body>

but when I run npm run watch command it is not displayed vue component. how can fix this problem?

my console output is,

[Vue warn]: Failed to mount component: template or render function not defined. found in ---> <Myfooter> <Root>

how can fix this problem?

Please sign in or create an account to participate in this conversation.