0๐
Can you try this:
<head>
<script src="{{ asset('js/app.js')}}"></script>
</head>
<body>
<div id="app">
<example-component></example-component>
</div>
</body>
0๐
Is your app.js file like this
require('./bootstrap');
window.Vue = require('vue');
Vue.component('Example', require('./components/Example.vue'));
const app = new Vue({
el: '#app'
});
Also, try to add the app.js to the bottom of the page
<body>
<div id="app">
<example-component></example-component>
</div>
<script src="{{ asset('js/app.js')}}"></script>
</body>
0๐
I presume you are using Chrome? Did you disable cache? If not: Open the dev tools and disbale caching when dev tools open (quick google search gives you many links how to do it), reload โ component will be there.
And make sure you have the component wrapped on the #app div.
If that doesnโt work โฆ show us app.js, component.js and also the blade templates.
- [Vuejs]-Haw can I add variable(value from getter) in router-link path in vue.js (with typescript)?
- [Vuejs]-Vue reactivity issues in component making asynchronous server requests
0๐
Try to change the script asset from:
<body>
<div id="app">
<example-component></example-component>
</div>
<script src="{{ asset('js/app.js')}}"></script>
</body>
To
<body>
<div id="app">
<example-component></example-component>
</div>
<script src="{{ asset('public/js/app.js')}}"></script>
</body>
It worked for me when I went through this problem
Source:stackexchange.com