-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] vue-router怎么配置404页面? #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
path: '*' |
path: '*' 是对的 但是应该放在最后一个 |
|
这里请教一下,为什么要放到最后,有什么影响吗 |
*代表全匹配 你放在第一个 不管地址是什么都会 匹配到了 放在最后一个 前面有的就不会匹配到 |
将path:*放在最后,因为如果你放在前面会导致后面的的不能匹配, |
export default {
path: '*',
name: '404',
component: '组件404',
} 需注意:将改路由配置放到所有路由的配置信息的最后,否则会其他路由path匹配造成影响。 |
{ |
{ |
[vue] vue-router怎么配置404页面?
The text was updated successfully, but these errors were encountered: