Closed VividLemon closed 1 year ago
This is the original issue, I linked it in the wrong location https://github.com/vuejs/router/issues/1801#issue-1671578700
I created a reproduction https://github.com/VividLemon/vue-router-issue
Here is the issue in summary:
When you do this.$router.push( { name: 'about', params: { id: undefined } } ). This works, but throws a TS error
this.$router.push( { name: 'about', params: { id: undefined } } )
When you do this.$router.push( { name: 'about', params: { id: '' } } ), this does NOT work, but throws no error.
this.$router.push( { name: 'about', params: { id: '' } } )
It will "appear" as if it works (for the second) but will not actually change the URL, and will throw a console warn.
This issue does not occur for vue-router@4 & vue 3
This is the original issue, I linked it in the wrong location https://github.com/vuejs/router/issues/1801#issue-1671578700
I created a reproduction https://github.com/VividLemon/vue-router-issue
Here is the issue in summary:
When you do
this.$router.push( { name: 'about', params: { id: undefined } } )
. This works, but throws a TS errorWhen you do
this.$router.push( { name: 'about', params: { id: '' } } )
, this does NOT work, but throws no error.It will "appear" as if it works (for the second) but will not actually change the URL, and will throw a console warn.
This issue does not occur for vue-router@4 & vue 3