From e2dec2052def97b7d5e7e34877d605ad5cd20c6e Mon Sep 17 00:00:00 2001 From: liuliu Date: Fri, 1 Sep 2023 11:29:22 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=89=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?2=EF=BC=89UIAbility=E7=83=AD=E5=90=AF=E5=8A=A8=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuliu Change-Id: I9d27bca1a852359c091e8c447360535ebde27e86 --- .../uiability-intra-device-interaction.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/zh-cn/application-dev/application-models/uiability-intra-device-interaction.md b/zh-cn/application-dev/application-models/uiability-intra-device-interaction.md index a9eb65d2f1..4f75fc772b 100644 --- a/zh-cn/application-dev/application-models/uiability-intra-device-interaction.md +++ b/zh-cn/application-dev/application-models/uiability-intra-device-interaction.md @@ -541,18 +541,20 @@ export default class FuncAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability - // ... + let url = 'pages/Index'; + if (this.funcAbilityWant?.parameters?.router && this.funcAbilityWant.parameters.router === 'funcA') { + url = 'pages/Second'; + } - let windowClass: window.Window; - windowStage.getMainWindow((err, data) => { + windowStage.loadContent(url, (err, data) => { if (err.code) { return; } - + let windowClass: window.Window; windowStage.getMainWindow((err, data) => { if (err.code) { - console.error(TAG, `Failed to obtain the main window. Code is ${err.code}, message is ${err.message}`); + console.error(`Failed to obtain the main window. Code is ${err.code}, message is ${err.message}`); return; } windowClass = data; -- GitLab