Skip to content Skip to sidebar Skip to footer

Vue Component Not Showing In Laravel

So I'm trying to migrate my jquery to vue framework instead, I'm using laravel 5.6 with webpack to build my project but my vue components are not showing up. when I run command npm

Solution 1:

you have to load your /resources/js/app.js file. put this inside your <head></head> tag

<scriptsrc="{{ asset('js/app.js') }}"defer></script>

Solution 2:

Some time you have re install npm

npm install
npm run dev

Thats solved my problem.

Solution 3:

:post="@json($classPost)" is your issue. @json doesn't escape the output for use in a HTML attribute, which is why your screenshot of the source in the browser has that line in bright red - it's invalid (because of the " characters in the resulting JSON, which end the attribute prematurely).

This'll do the trick:

:post="{{ json_encode($classPost) }}"

Solution 4:

I think you need to load app.js before </body> as below.

<body id="app"class="">
  //sidebar<scriptsrc=" {{ mix('js/app.js') }} "></script>
</body>

Post a Comment for "Vue Component Not Showing In Laravel"