mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 00:14:18 +00:00
fix(cli): iframe route sync failed
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { nextTick } from 'vue';
|
||||
import { watch, nextTick } from 'vue';
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
import DemoHome from './components/DemoHome';
|
||||
import { decamelize } from '../common';
|
||||
@@ -89,7 +89,7 @@ export const router = createRouter({
|
||||
scrollBehavior: (to, from, savedPosition) => savedPosition || { x: 0, y: 0 },
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
watch(router.currentRoute, () => {
|
||||
if (!router.currentRoute.value.redirectedFrom) {
|
||||
nextTick(window.syncPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user