mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
feat(cli): support custom simulator (#8499)
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
* 同步父窗口和 iframe 的 vue-router 状态
|
||||
*/
|
||||
|
||||
import { config } from 'site-desktop-shared';
|
||||
|
||||
let queue = [];
|
||||
let isIframeReady = false;
|
||||
|
||||
@@ -27,7 +29,12 @@ if (window.top === window) {
|
||||
|
||||
function getCurrentDir() {
|
||||
const router = window.vueRouter;
|
||||
return router.currentRoute.value.path;
|
||||
const { path } = router.currentRoute.value;
|
||||
|
||||
if (config.site.simulator?.routeMapper) {
|
||||
return config.site.simulator?.routeMapper(path);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
export function syncPathToParent() {
|
||||
|
Reference in New Issue
Block a user