fix(router): don't prepend /
unnecessarily to Location paths
Closes #6729 Closes #5502
This commit is contained in:

committed by
Igor Minar

parent
d86be245b8
commit
c6036435f0
@ -438,7 +438,7 @@ export class RootRouter extends Router {
|
||||
}
|
||||
var emitPath = instruction.toUrlPath();
|
||||
var emitQuery = instruction.toUrlQuery();
|
||||
if (emitPath.length > 0) {
|
||||
if (emitPath.length > 0 && emitPath[0] != '/') {
|
||||
emitPath = '/' + emitPath;
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ export class RootRouter extends Router {
|
||||
commit(instruction: Instruction, _skipLocationChange: boolean = false): Promise<any> {
|
||||
var emitPath = instruction.toUrlPath();
|
||||
var emitQuery = instruction.toUrlQuery();
|
||||
if (emitPath.length > 0) {
|
||||
if (emitPath.length > 0 && emitPath[0] != '/') {
|
||||
emitPath = '/' + emitPath;
|
||||
}
|
||||
var promise = super.commit(instruction);
|
||||
|
Reference in New Issue
Block a user