修正监听oakpath时 判断错误

This commit is contained in:
Wang Kejun 2023-11-10 12:21:40 +08:00
parent 054352b411
commit 21061896f4
3 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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 &&

View File

@ -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的情况请检查代码修正'