We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] 在使用vue-cli开发vue项目时,自动刷新页面的原理你了解吗?
The text was updated successfully, but these errors were encountered:
我觉得应该是使用了webpack-dev的热重载模块,热重载的原理应该是socket,再具体一点就母鸡了
Sorry, something went wrong.
自动刷新页面并不是vue-cli的功能,而是webpack的hot-module-replacement-plugin插件在做这件事,这个插件是webpack自带的插件,用来做hmr的。如果需要配置hmr只需要在webpack.config.js的devServer字段写 下面的配置即可。 { contentBase: 服务器可以访问的根目录, hot:true, //开启热模块替换也就是hmr hotOnly:true //不刷新页面,只做hmr } 而由于vue-cli3集成了webpack的配置,所以vue.config.js里面也有这个属性,配置写法是一样的。
No branches or pull requests
[vue] 在使用vue-cli开发vue项目时,自动刷新页面的原理你了解吗?
The text was updated successfully, but these errors were encountered: