Using import in laravel is always the wrong path.

blade template is as follows
clipboard.png


clipboard.png

app.js

clipboard.png


clipboard.png

Can"t

be introduced locally? the Great God asks for advice

.
May.06,2022

  1. path is wrong. The web page directly accesses the public directory and cannot access resources
  2. you can't use vue directly in your browser, you need to package it into js with laravel mix. That's why you have no problem putting it in app.js. Npm run production or dev will help you compile
  3. .

solution: configure the packaging path in webpack.mix.js for each page you need, and then reference the packaged js

in the page you need.
Menu