Commit e746081c authored by rockyl's avatar rockyl

修改数据中心获取空数据的问题

修改自定义常量可以通过表达式获取
修改oss密钥
parent a757d535
{"id":"engine","url":"engine.90b8f75c7c269eab8a9476fee14257118c0828a9.js"}
\ No newline at end of file
{"id":"engine","url":"engine.fe1c152c762e3bad43fe201bc9d9704676e8b275.js"}
\ No newline at end of file
module.exports = {
region: 'oss-cn-hangzhou',
id: 'LTAIqO2wblIxQvwc',
secret: '4brsaSRbRpjxw3oDIxJi6bNMcndIR6',
id: 'LTAI4Fw25WcfcGv7FvcHoiHK',
secret: 'NZk1NtT9J5HFaAolNbtQdzTzLLvLYm',
bucket: 'duiba',
output: '/editor/zeroing/libs'
};
......@@ -4,7 +4,7 @@
* 过程
*/
import {VM} from "./VM";
import {getDataByPath, linkedFlag, linkScheme, nodeScheme, objClone} from "../utils";
import {getDataByPath, linkScheme, nodeScheme, objClone} from "../utils/index";
import {dataCenter} from "../game-warpper/data-center";
import {env} from "../game-warpper/enviroment";
import {getLogSwitch, Logs} from "../log-switch";
......@@ -241,7 +241,7 @@ export class Process {
props[key] = nameValue !== undefined ? nameValue : dataCenter.getDataByPath(name);
break;
case 'env':
props[key] = env[name];
props[key] = getDataByPath(env, name);
break;
case 'map':
this.updateProps(props[key] = {}, args, name, name);
......
......@@ -84,7 +84,7 @@ export class DataCenter extends EventDispatcher {
let name = args[0];
let dataMapping = this.getDataMapping(name);
try {
let data: any = this.getDataByPath(dataMapping.path, undefined, true);
let data: any = this.getDataByPath(dataMapping.path, undefined, false);
if (args[1] !== undefined) {
data = data[args[1]];
}
......
......@@ -199,6 +199,7 @@ export const commands: { [name: string]: Command } = {
parent.addChild(newNode);
// 生成子域
let newScope: any = Object.create(forScope);
// 这里一定要用defineProperty将目标定义在当前节点上,否则会影响forScope
Object.defineProperty(newScope, "$index", {
configurable: true,
......@@ -236,6 +237,13 @@ export const commands: { [name: string]: Command } = {
value: (isArray ? curList[curIndex] : curList[curIndex].value),
writable: false
});
// 把单项数据注入到显示对象上
Object.defineProperty(newNode, "$data", {
configurable: true,
enumerable: false,
value: (isArray ? curList[curIndex] : curList[curIndex].value),
writable: false
});
// 开始编译新节点
context.compiler.compile(newNode, newScope);
// 赋值上一个节点
......
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