Skip to content

fix: replace existing route in addRoute show warning msg#3519

Open
qiuzuhui wants to merge 2 commits intovuejs:devfrom
qiuzuhui:dev
Open

fix: replace existing route in addRoute show warning msg#3519
qiuzuhui wants to merge 2 commits intovuejs:devfrom
qiuzuhui:dev

Conversation

@qiuzuhui
Copy link
Copy Markdown

fix: addRoute is not work when there is already route with same name. replaced existing route in addRoute and show warning msg

@hendrikheil
Copy link
Copy Markdown

Would love to see this merged. We currently have to use a fork to get the documented behavior, which is not ideal

Tested this and can confirm it works as expected 👍

@9-lives
Copy link
Copy Markdown

9-lives commented Jul 5, 2021

没有人 merge 吗?

Comment thread src/create-route-map.js
pathList.push(record.path)
pathMap[record.path] = record
}
pathMap[record.path] = record
Copy link
Copy Markdown

@rwaltenberg rwaltenberg Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is undocumented behavior. The documentation states that only if the route has a name and the name matches with an existing route, it should be overwritten.

@772778995
Copy link
Copy Markdown

Niubitli!!

@Cheaterman
Copy link
Copy Markdown

VueJS please fix

@000Sonic
Copy link
Copy Markdown

+1

1 similar comment
@panruza
Copy link
Copy Markdown

panruza commented Apr 10, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

addRoute() with name couldn't replace the existing rule with the same name.

8 participants