需求:想要在菜单配置src/assets/iconfont/chart.html显示页面(目的是打包上线以后运维依然可以修改数据)
官网没有相关数据:菜单配置说明 · JeecgBoot 开发文档 · 看云

问题现象:
我把文件放在src/assets/iconfont/chart.html然后在vue中作为 iframe
的 src
属性,正确加载 chart.html
文件,使用普通叶子菜单配置


不能正常显示显示404(路径是正确的)

解决方法:
把html放到public文件夹下路径改成/chart.html可以正常显示

解释
public
目录:public
目录中的文件会被直接复制到构建输出目录中,不会被 Webpack 处理。因此,chart.html
文件会被直接放在构建输出目录的根目录下**。**src="/chart.html"
:使用/chart.html
作为iframe
的src
属性,这样无论你在哪个路由下访问,都能正确加载chart.html
文件。