mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 16:04:04 +00:00
fix(@vant/cli): doc preview page cannot scroll to the correct anchor (#7745)
Co-authored-by: caoenze <caoenze@didichuxing.com>
This commit is contained in:
@@ -109,7 +109,7 @@ export const router = createRouter({
|
||||
routes: getRoutes(),
|
||||
scrollBehavior(to) {
|
||||
if (to.hash) {
|
||||
return { selector: to.hash };
|
||||
return { el: to.hash };
|
||||
}
|
||||
|
||||
return { x: 0, y: 0 };
|
||||
|
@@ -30,9 +30,7 @@ export default {
|
||||
if (event.target.id) {
|
||||
this.$router.push({
|
||||
name: this.$route.name,
|
||||
query: {
|
||||
anchor: event.target.id
|
||||
}
|
||||
hash: '#' + event.target.id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user