[Vuejs]-Laravel blade.php use JavaScript compiled by mix to app.js

0👍

I think you’re getting the error because you’re placing a new script tag inside of the vue.js application div.

If you’re opening your layout file app.blade.php there is a div with id="app" and inside it you’re having your content section yield. Side-effect means that you shouldn’t load a new script inside a Vue.js template.

The script should be in your layout at the end of the body tag. Also the script tag should look like this:
<script src="{{ asset('js/app.js') }}"></script>

Then your script should be available. But I would have a look at Vue.js and how you’re handling click events there. click handler docs

👤AWolf

0👍

Try this I solved me

<script src="{{ asset('js/app.js') }}?time={{ time() }}"></script>

" I think not all browsers support this "

Leave a comment