From 9072642f2211911c9886987b33d05bfee1836daa Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 2 Oct 2023 17:11:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(runtime):=20=E6=94=AF=E6=8C=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/react/page/main.tsx | 1 + runtime/vue2/page/main.ts | 1 + runtime/vue3/page/main.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/runtime/react/page/main.tsx b/runtime/react/page/main.tsx index 53d25055..3a895ea1 100644 --- a/runtime/react/page/main.tsx +++ b/runtime/react/page/main.tsx @@ -61,6 +61,7 @@ const app = new Core({ ua: window.navigator.userAgent, config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {}, curPage: getUrlParam('page'), + useMock: Boolean(getUrlParam('useMock')), }); app.setDesignWidth(app.env.isWeb ? window.document.documentElement.getBoundingClientRect().width : 375); diff --git a/runtime/vue2/page/main.ts b/runtime/vue2/page/main.ts index 3d6532f5..ab0aa44f 100644 --- a/runtime/vue2/page/main.ts +++ b/runtime/vue2/page/main.ts @@ -50,6 +50,7 @@ const app = new Core({ ua: window.navigator.userAgent, config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {}, curPage: getUrlParam('page'), + useMock: Boolean(getUrlParam('useMock')), }); app.setDesignWidth(app.env.isWeb ? window.document.documentElement.getBoundingClientRect().width : 375); diff --git a/runtime/vue3/page/main.ts b/runtime/vue3/page/main.ts index 4282a058..08133e05 100644 --- a/runtime/vue3/page/main.ts +++ b/runtime/vue3/page/main.ts @@ -52,6 +52,7 @@ const app = new Core({ ua: window.navigator.userAgent, config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {}, curPage: getUrlParam('page'), + useMock: Boolean(getUrlParam('useMock')), }); app.setDesignWidth(app.env.isWeb ? window.document.documentElement.getBoundingClientRect().width : 375);