How do I make Example.vue update in Laravel?

前提是你 提交于 2019-12-08 03:25:41

问题


I just read the answers to this question and wasn't able to get a good response.

Laravel Example.vue not updating

I also posted this question trying to figure it out on my own but to no avail.

how do I load a Vue component in Laravel 5.4?

As another attempt, I just did a new reinstall of Laravel, and while I am able to get the default Example.vue component to load multiple times in a single view, I am still unable to change the contents of the component. Funnier thing is that when I run npm install and then npm run dev, the component ceases to even show up anymore.

This is really frustrating because Laravel ships with Vue.js yet I am unable to utilize it. Any help would be much appreciated! :)


回答1:


You need to install the node dependencies and then compile them.

  1. Install node.js
  2. From your projects root run npm install
  3. From your projects root run npm run dev

Your browser may also be showing the cached version. Chrome has a setting that you can have the cache disabled while the inspector is open.

You can also check it by opening your project in other browsers.

If when running npm run dev dies without any message of any kind you can delete your node_modules folder then run npm install and then compile your assets again.

You may also need to clear and rebuild a few other caches with commands:

composer dump-autoload
php artisan clear-compiled
php artisan cache:clear
  • https://laravel.com/docs/5.4/mix

  • https://laravel.com/docs/5.4/frontend



来源:https://stackoverflow.com/questions/43312756/how-do-i-make-example-vue-update-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!