![](/img/trans.png)
[英]Laravel 4 migrate:make not working; just stops after “Compiling views” step
[英]npm run watch stops compiling after compiling once (laravel 8 homestead + Vue)
当我使用 npm 运行手表时,它会编译我的更改并更新页面,当我进行另一次编辑时,它也会编译它。 但是,在第一次编辑之后,它将停止更新我的页面。 我没有收到任何错误。 当我退出它并运行 npm run watch 时,它会再次编译这些更改,所以我认为不是我正在编辑的代码导致它。
我尝试过的事情:
这是我的混合文件:
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.vue()
.sass('resources/sass/app.scss', 'public/css');
这是我的 package.json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21.1",
"bootstrap": "^4.0.0",
"browser-sync": "^2.26.14",
"browser-sync-webpack-plugin": "^2.3.0",
"jquery": "^3.2",
"laravel-mix": "^6.0.16",
"lodash": "^4.17.19",
"popper.js": "^1.12",
"postcss": "^8.1.14",
"resolve-url-loader": "^2.3.1",
"sass": "^1.20.1",
"sass-loader": "^8.0.0",
"vue": "^2.5.17",
"vue-loader": "^15.9.5",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"vue-axios": "^3.2.4",
"vue-router": "^3.5.1"
}
}
我有同样的问题,并尝试了一切。 最终我发现问题在于我如何导入路由。
{
path: '/test',
name: 'test',
component: () => import("../views/pages/test.vue")
},
我忘了用大写字母。
component: () => import("../views/pages/test.vue")
应该:
component: () => import("../views/pages/Test.vue")
显然,当我运行“npm run watch”laravel 时,即使我写了“test.vue”,也可以导入我的 Test.vue。 但是,在初始启动 laravel 混合使用动态加载之后,如果我不使用大写字母,它将忽略更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.