How do I make Example.vue update in Laravel?(如何在 Laravel 中更新 Example.vue?)
问题描述
我刚刚阅读了这个问题的答案,并没有得到很好的答复.
I just read the answers to this question and wasn't able to get a good response.
Laravel Example.vue 未更新
我也发布了这个问题,试图自己解决,但无济于事.
I also posted this question trying to figure it out on my own but to no avail.
如何加载 Vue 组件在 Laravel 5.4 中?
作为另一次尝试,我刚刚重新安装了 Laravel,虽然我能够在一个视图中多次加载默认的 Example.vue 组件,但我仍然无法更改组件的内容.更有趣的是,当我运行 npm install 然后 npm run dev 时,组件甚至不再出现.
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.
这真的很令人沮丧,因为 Laravel 附带了 Vue.js,但我无法使用它.任何帮助将非常感激!:)
This is really frustrating because Laravel ships with Vue.js yet I am unable to utilize it. Any help would be much appreciated! :)
推荐答案
需要安装node依赖,然后编译.
You need to install the node dependencies and then compile them.
- 安装 node.js
- 从您的项目根目录运行
npm install
- 从您的项目根目录运行
npm run dev
您的浏览器也可能显示缓存版本.Chrome 有一个设置,您可以在检查器打开时禁用缓存.
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.
如果在运行 npm run dev
时没有任何消息,你可以删除你的 node_modules 文件夹,然后运行 npm install
然后再次编译你的资产.
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
这篇关于如何在 Laravel 中更新 Example.vue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Laravel 中更新 Example.vue?
基础教程推荐
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01