Laravel Example.vue没有更新 [英] Laravel Example.vue not updating

查看:123
本文介绍了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天全站免登陆