1、在application.propertis中新增如下配置
spring.thymeleaf.cache=false
2、在idea中intellij idea-perference-Build,Execution,Deployment-Complier中勾上Build project automatically
3、在idea中按command+option+shift+/选择Registry,勾选compiler.automake.allow.when.app.running
4、不过要注意一下,修改完html后一定要ctrl+f9重新build一下,再回到浏览器刷新,就能看到效果了。(之前在windows上好像不需要)