没有指定新 hash 时保留原有 hash
This commit is contained in:
parent
5a06bb2985
commit
4a0d1a26ee
|
@ -55,7 +55,7 @@ export default function(schema) {
|
||||||
? to.substring(0, idx2)
|
? to.substring(0, idx2)
|
||||||
: to;
|
: to;
|
||||||
let search = ~idx ? to.substring(idx, ~idx2 ? idx2 : undefined) : '';
|
let search = ~idx ? to.substring(idx, ~idx2 ? idx2 : undefined) : '';
|
||||||
let hash = ~idx2 ? to.substring(idx2) : '';
|
let hash = ~idx2 ? to.substring(idx2) : location.hash;
|
||||||
|
|
||||||
if (!pathname) {
|
if (!pathname) {
|
||||||
pathname = location.pathname;
|
pathname = location.pathname;
|
||||||
|
@ -77,6 +77,7 @@ export default function(schema) {
|
||||||
};
|
};
|
||||||
this.env = {
|
this.env = {
|
||||||
updateLocation: (location, replace) => {
|
updateLocation: (location, replace) => {
|
||||||
|
debugger;
|
||||||
router[replace ? 'replace' : 'push'](normalizeLink(location));
|
router[replace ? 'replace' : 'push'](normalizeLink(location));
|
||||||
},
|
},
|
||||||
isCurrentUrl: to => {
|
isCurrentUrl: to => {
|
||||||
|
|
Loading…
Reference in New Issue