简体   繁体   English

Laravel和Vue.js无法看到CSS和JS文件

[英]Laravel and Vue.js cannot see the css and js files

I have my project written in Laravel + Vue.js. 我的项目是用Laravel + Vue.js编写的。 (It is not my project, but I have to improve it. I can not show code because I have NDA so i will only ask. It is API in laravel + front in laravel + vue. I committed that project, updated two .env's and installed it using: composer update npm install php artisan serve (这不是我的项目,但是我必须改进它。因为我有NDA,所以我无法显示代码,所以我只会问。这是laravel中的API + laravel + vue中的front。我提交了这个项目,更新了两个.env并使用以下工具进行安装:composer update npm install php artisan serve

But there is problem because where I am on the page (127.0.0.1:8000) I see blank page. 但是有问题,因为我在页面上的位置(127.0.0.1:8000)我看到空白页。 Here's some console: 这是一些控制台: 在此处输入图片说明

When I am doing 127.0.0.1:8000/js/app.js I see: 当我做127.0.0.1:8000/js/app.js时,我看到了: 在此处输入图片说明

That doesn't works even when I have 777 chmod's on all project. 即使我在所有项目上都安装了777 chmod,这也不起作用。

And command npm install every time says "114 installed 10 updated". 并且命令npm install每次都说“ 114已安装10更新”。 Why this notice is not updating to 0? 为什么此通知未更新为0?

Can u help me? 你能帮我吗? What can I try? 我可以尝试什么?

  1. i thinks this is happening because you link to public/js/ is not right. 我认为这是因为您链接到public / js /是不正确的。 try this. 尝试这个。

    src="{{ asset('js/app.js') }}" src =“ {{asset('js / app.js')}}”

hope it helps. 希望能帮助到你。

i will be happy to see the web.php file also. 我也很高兴看到web.php文件。 thnx n

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM