修正监听oakpath时 判断错误
This commit is contained in:
parent
054352b411
commit
21061896f4
|
|
@ -451,7 +451,7 @@ const oakBehavior = Behavior({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setState(pathState, () => {
|
this.setState(pathState, () => {
|
||||||
if (data.oakPath === undefined) {
|
if (data === undefined) {
|
||||||
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
||||||
console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正');
|
console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正');
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
|
|
@ -539,7 +539,8 @@ function translatePropertiesToPropertyDefinitions(properties) {
|
||||||
type: String,
|
type: String,
|
||||||
value: properties[prop],
|
value: properties[prop],
|
||||||
};
|
};
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
definitions[prop] = String;
|
definitions[prop] = String;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -565,16 +566,19 @@ function translatePropertiesToPropertyDefinitions(properties) {
|
||||||
type: Array,
|
type: Array,
|
||||||
value: properties[prop],
|
value: properties[prop],
|
||||||
};
|
};
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
definitions[prop] = Array;
|
definitions[prop] = Array;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (Object.keys(properties[prop]).length > 0) {
|
if (Object.keys(properties[prop]).length > 0) {
|
||||||
definitions[prop] = {
|
definitions[prop] = {
|
||||||
type: Object,
|
type: Object,
|
||||||
value: properties[prop],
|
value: properties[prop],
|
||||||
};
|
};
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
definitions[prop] = Object;
|
definitions[prop] = Object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -584,7 +588,6 @@ function translatePropertiesToPropertyDefinitions(properties) {
|
||||||
Object.assign(definitions, {
|
Object.assign(definitions, {
|
||||||
[prop]: Object,
|
[prop]: Object,
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
// 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
|
// 小程序也支持传函数 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,7 @@ const oakBehavior = Behavior({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setState(pathState, () => {
|
this.setState(pathState, () => {
|
||||||
if (data.oakPath === undefined) {
|
if (data === undefined) {
|
||||||
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
||||||
console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正');
|
console.warn('发生了结点先形成再配置oakPath的情况,请检查代码修正');
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
|
|
|
||||||
|
|
@ -670,7 +670,7 @@ const oakBehavior = Behavior<
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setState(pathState as any, () => {
|
this.setState(pathState as any, () => {
|
||||||
if (data.oakPath === undefined) {
|
if (data === undefined) {
|
||||||
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
// 如果每个页面都在oakFullpath形成后再渲染子结点,这个if感觉是不应该命中的
|
||||||
console.warn(
|
console.warn(
|
||||||
'发生了结点先形成再配置oakPath的情况,请检查代码修正'
|
'发生了结点先形成再配置oakPath的情况,请检查代码修正'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue