I'm trying to display a vue component which is in assets/js/components/LoginComponent.vue which look like this
<template>
<h1>hello</h1>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>
and the app.js is like this
require('./bootstrap');
window.Vue = require('vue');
Vue.component('login-component', require('./components/LoginComponent.vue'));
const app = new Vue({
el: '#app'
});
and the blade which am trying to import my vuejs component is like this
<body>
<div id="app">
<login-component></login-component>
@yield('content')
</div>
</body>
it displays all the page without the component any idea how to solve it ?
components: {login-component}in your app component? - Bennett Dams