We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8460804 commit 6c7375aCopy full SHA for 6c7375a
examples/pages/template/component.tpl
@@ -240,11 +240,14 @@
240
beforeRouteUpdate(to, from, next) {
241
next();
242
setTimeout(() => {
243
- if (location.href.match(/#/g).length < 2) {
+ const toPath = to.path;
244
+ const fromPath = from.path;
245
+ if (toPath === fromPath && to.hash) {
246
+ this.goAnchor();
247
+ }
248
+ if (toPath !== fromPath) {
249
document.documentElement.scrollTop = document.body.scrollTop = 0;
250
this.renderAnchorHref();
- } else {
- this.goAnchor();
251
}
252
}, 100);
253
0 commit comments