在学习vue框架的时候,用到mode:history的时候在页面url中结果还是会有 ‘#’
后来去vue-router官方文档的时候才知道有新的 history 配置取代 mode
(官方原文档)mode: ‘history’ 配置已经被一个更灵活的 history 配置所取代。根据你使用的模式,你必须用适当的函数替换它:
“history”: createWebHistory()
“hash”: createWebHashHistory()
“abstract”: createMemoryHistory()
const router = createRouter({
history: createWebHistory(),
routes
})