<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[kcorgi的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/kcorgi</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; kcorgi]]></copyright><item><title><![CDATA[解决Vue3.0刷新页面警告[Vue Router warn]:No match found for location with path /xxx]]></title><link>https://blog.youkuaiyun.com/kcorgi/article/details/141504017</link><guid>https://blog.youkuaiyun.com/kcorgi/article/details/141504017</guid><author>kcorgi</author><pubDate>Sat, 24 Aug 2024 19:56:05 +0800</pubDate><description><![CDATA[当我们在使用vue-Route4.0以前的版本的时候，我们采用的404错误页面的路径，是用router.addRoutes或者push动态添加进去的。但是vue-Route4.0版本更新以后，刷新页面或者第一次访问动态的路由，全局守卫beforeEach执行。但是这时候我们还没有动态追加路由，找不到，而且我们是后续追加的404，从而导致第一次路由的matched为空。vue-Route4.0版本已经不需要我们去动态添加404路由了。这样刷新后会跳转至404页面，不会留在刷新前的页面。]]></description><category></category></item></channel></rss>