From 21061896f4902d8f3fac1928deefd14037815d0d Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Fri, 10 Nov 2023 12:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=9B=91=E5=90=ACoakpath?= =?UTF-8?q?=E6=97=B6=20=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/page.mp.js | 15 +++++++++------ lib/page.mp.js | 2 +- src/page.mp.ts | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/es/page.mp.js b/es/page.mp.js index 7e998770..49d3cee2 100644 --- a/es/page.mp.js +++ b/es/page.mp.js @@ -451,7 +451,7 @@ const oakBehavior = Behavior({ return; } this.setState(pathState, () => { - if (data.oakPath === undefined) { + if (data === undefined) { // 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的 console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正'); this.oakOption.lifetimes?.ready && @@ -539,7 +539,8 @@ function translatePropertiesToPropertyDefinitions(properties) { type: String, value: properties[prop], }; - } else { + } + else { definitions[prop] = String; } break; @@ -565,16 +566,19 @@ function translatePropertiesToPropertyDefinitions(properties) { type: Array, value: properties[prop], }; - } else { + } + else { definitions[prop] = Array; } - } else { + } + else { if (Object.keys(properties[prop]).length > 0) { definitions[prop] = { type: Object, value: properties[prop], }; - } else { + } + else { definitions[prop] = Object; } } @@ -584,7 +588,6 @@ function translatePropertiesToPropertyDefinitions(properties) { Object.assign(definitions, { [prop]: Object, }); - break; } default: { // 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html diff --git a/lib/page.mp.js b/lib/page.mp.js index 2e78abbf..6532ed71 100644 --- a/lib/page.mp.js +++ b/lib/page.mp.js @@ -454,7 +454,7 @@ const oakBehavior = Behavior({ return; } this.setState(pathState, () => { - if (data.oakPath === undefined) { + if (data === undefined) { // 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的 console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正'); this.oakOption.lifetimes?.ready && diff --git a/src/page.mp.ts b/src/page.mp.ts index 24c393d4..3dddfba3 100644 --- a/src/page.mp.ts +++ b/src/page.mp.ts @@ -670,7 +670,7 @@ const oakBehavior = Behavior< return; } this.setState(pathState as any, () => { - if (data.oakPath === undefined) { + if (data === undefined) { // 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的 console.warn( '发生了结点先形成再配置oakPath的情况,请检查代码修正'