Reputation: 7052
My app.js
file is like below.
require('./bootstrap');
window.Vue = require('vue').default;
Vue.component('mosque-component', require('./components/MosqueComponent.vue').default);
Vue.component('prayer-component', require('./components/PrayerComponent.vue').default);
Vue.component('time-component', require('./components/TimeComponent.vue').default);
const app = new Vue({
el: '#content',
});
I added app.js
file like below.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="{{ asset('js/app.js') }}" defer></script>
</head>
<body class="footer-offset">
</body>
</html>
I ran npm install
, npm install vue
and npm run dev
. But I am getting below error. I can't see VueJS output also.
Upvotes: 0
Views: 494
Reputation: 4704
Instead of this-
window.Vue = require('vue').default;
Use like this-
window.Vue = require("vue");
As you are using el: '#content'
, make sure you have an element with id content
in your blade file.
Upvotes: 1