1.File——Settings——Build
2.Build,Execution,Deplyment——Compiler
3.选中打勾 “Build project automatically“
4.按OK
5. 按住 Shift+Ctrl+Alt+/ ,然后选中 Registry
6.勾选compiler.automake.allow.when.app.running
7.最后在需要刷新时点击下图所示的箭头,再在html页面刷新即可
具体见:https://blog.csdn.net/weixin_43234960/article/details/101368542