Laravel Example.vue 未更新 [英] Laravel Example.vue not updating

查看:25
本文介绍了Laravel Example.vue 未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何在 Laravel 5 项目中使用 Vue.基本的 Laravel 安装附带 app.js 和 Example.vue.我能够拥有我是一个示例组件!"通过添加到 home.blade.php 显示在我的视图中.令我感到困惑的是,我根本无法更改此组件以及其他问题.

I'm trying to figure out how to use Vue in a Laravel 5 project. Basic Laravel install ships with app.js and Example.vue. I was able to have the "I'm an example component!" show up in my view by adding to home.blade.php. What's mystifying me is that I can't change this component at all, among other issues.

如果我更改 Example.vue 中的文本(仅在模板部分,而不是逻辑中),它根本不会更新.(我试过按照 Laravel 文档等运行 npm run dev ,它似乎编译没有错误,当时修改了/public/js/app.js,但浏览器中的视图没有改变.)

If I change the text in the Example.vue (just in the template part, not the logic) it doesn't update at all. (I've tried running npm run dev as per Laravel docs, etc, and it seems to compile without errors, and /public/js/app.js is modified at that time, but the view in the browser doesn't change.)

当我修改 app.blade.php 时,会显示这些更改,就像 home.blade.php 中的更改一样.但是,我找不到证据表明更改/resources/assets/js/app.js 或 Example.vue 的内容有任何影响.更令人困惑的是,如果我从 app.blade.php div 元素中删除 id="app" ,这不会导致 Example 组件消失.基于玩 vue jsfiddle,这似乎应该破坏组件.

When I modify app.blade.php, those changes show up, as do changes in home.blade.php. However, I can't find evidence that changing the content of /resources/assets/js/app.js or Example.vue has any effect. Even more confusing, if I remove the id="app" from app.blade.php div element, this does not cause the Example component to disappear. Based on playing with the vue jsfiddle, it seems like this should break the component.

我不确定这是某种缓存问题,还是编译问题,或者我不了解 vue 的工作方式,或者什么,但我不知道出了什么问题.我直接使用 laravel 安装中的 webpack.mix.js 文件,我尝试停止并重新启动 vagrant,并重新加载浏览器和 php artisan cache:clear.(之前我尝试使用 Elixir 而不是 Mix,以及 vueify 和 gulp,同样的问题.)

I'm not sure if it's some sort of caching issue, or compile issue, or I'm not understanding the way vue works, or what, but I have no idea what's going wrong. I'm using the webpack.mix.js file straight out of the laravel installation, and I tried halting and restarting vagrant, and reloading the browser, and php artisan cache:clear. (Earlier I tried using Elixir instead of Mix, and vueify and gulp, same issue.)

任何建议将不胜感激!

推荐答案

您是否尝试从浏览器 (F12) 打开您的控制台,然后转到网络并选中和取消选中禁用缓存,然后重新加载您的页面.使用旧存储文件的浏览器.

did u try to open ur console from browser (F12) then go to network and check and uncheck the disable cache then reload your page. something your browser using your old storage files.

这篇关于Laravel Example.vue 未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆