.在index.html引入的时候,将相对路径转换成绝对路径
相对路径:<link rel="stylesheet" type="text/css" href="./css/reset.css">
绝对路径:<link rel="stylesheet" type="text/css" href="/css/reset.css">
网上查询还有的说把 router.js的 history模式去掉 结果我试了不行 改成相对路径就可以了
本文介绍了一种在index.html中将相对路径转换为绝对路径的方法,这对于资源文件如CSS的正确加载至关重要。通过实例展示了如何从相对路径<link rel=stylesheet type=text/css href=./css/reset.css>转换到绝对路径<link rel=stylesheet type=text/css href=/css/reset.css>,并提到了在某些情况下,更改router.js的history模式可能无效,使用相对路径则能解决问题。
.在index.html引入的时候,将相对路径转换成绝对路径
相对路径:<link rel="stylesheet" type="text/css" href="./css/reset.css">
绝对路径:<link rel="stylesheet" type="text/css" href="/css/reset.css">
网上查询还有的说把 router.js的 history模式去掉 结果我试了不行 改成相对路径就可以了
1029