Commit d0c4741f authored by rockyl's avatar rockyl

修复过程props缺少的问题

parent 54b6ab20
...@@ -1880,6 +1880,9 @@ ...@@ -1880,6 +1880,9 @@
return exports; return exports;
} }
function trimChar(str, char) { function trimChar(str, char) {
if (!str || !char) {
return;
}
while (true) { while (true) {
var len = str.length, from = 0, end = len; var len = str.length, from = 0, end = len;
if (str[0] === char) { if (str[0] === char) {
...@@ -2377,10 +2380,10 @@ ...@@ -2377,10 +2380,10 @@
case 'link': case 'link':
var linkedValue = this.resolveLinkedProp(value, key); var linkedValue = this.resolveLinkedProp(value, key);
if (linkedValue !== undefined) { if (linkedValue !== undefined) {
props[key] = undefined; props[key] = linkedValue;
} }
else { else {
props[key] = linkedValue; props[key] = undefined;
} }
break; break;
case 'static': case 'static':
...@@ -2407,6 +2410,9 @@ ...@@ -2407,6 +2410,9 @@
props[key] = findNodeByUUID(this._vm.globalContext.gameStage, uuid); props[key] = findNodeByUUID(this._vm.globalContext.gameStage, uuid);
} }
} }
else if (originProps[key] !== undefined) {
props[key] = originProps[key];
}
if (props[key] === undefined && propsConfig[key].hasOwnProperty('default')) { if (props[key] === undefined && propsConfig[key].hasOwnProperty('default')) {
props[key] = propsConfig[key]['default']; props[key] = propsConfig[key]['default'];
} }
......
This diff is collapsed.
...@@ -183,9 +183,9 @@ export class Process { ...@@ -183,9 +183,9 @@ export class Process {
case 'link': case 'link':
let linkedValue = this.resolveLinkedProp(value, key); let linkedValue = this.resolveLinkedProp(value, key);
if (linkedValue !== undefined) { if (linkedValue !== undefined) {
props[key] = undefined;
}else{
props[key] = linkedValue; props[key] = linkedValue;
}else{
props[key] = undefined;
} }
break; break;
case 'static': case 'static':
...@@ -210,6 +210,8 @@ export class Process { ...@@ -210,6 +210,8 @@ export class Process {
if (uuid) { if (uuid) {
props[key] = findNodeByUUID(this._vm.globalContext.gameStage, uuid); props[key] = findNodeByUUID(this._vm.globalContext.gameStage, uuid);
} }
}else if(originProps[key] !== undefined){
props[key] = originProps[key];
} }
if (props[key] === undefined && propsConfig[key].hasOwnProperty('default')) { if (props[key] === undefined && propsConfig[key].hasOwnProperty('default')) {
......
...@@ -164,6 +164,9 @@ export function importUMDCode(code) { ...@@ -164,6 +164,9 @@ export function importUMDCode(code) {
} }
export function trimChar(str: string, char: string) { export function trimChar(str: string, char: string) {
if (!str || !char) {
return;
}
while (true) { while (true) {
let len = str.length, from = 0, end = len; let len = str.length, from = 0, end = len;
if (str[0] === char) { if (str[0] === char) {
...@@ -194,7 +197,7 @@ export function findVariable(name: string, ...contexts) { ...@@ -194,7 +197,7 @@ export function findVariable(name: string, ...contexts) {
for (let context of contexts) { for (let context of contexts) {
if (context) { if (context) {
result = context[name]; result = context[name];
if(result !== undefined){ if (result !== undefined) {
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment