当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript obj.obj_setProperty函数代码示例

本文整理汇总了TypeScript中@utils/obj.obj_setProperty函数的典型用法代码示例。如果您正苦于以下问题:TypeScript obj_setProperty函数的具体用法?TypeScript obj_setProperty怎么用?TypeScript obj_setProperty使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了obj_setProperty函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: mask_config

export function mask_config (a?, b?, c?) {
	var args = arguments,
		length = args.length
	if (length === 0) {
		return __cfg;
	}
	if (length === 1) {
		let x = args[0]
		if (is_Object(x)) {
			obj_extend(__cfg, x);
			listeners_emit('config', x);
			return;
		}
		if (is_String(x)) {
			return obj_getProperty(__cfg, x);
		}
	}
	if (length === 2) {
		var prop = args[0];
		if (obj_hasProperty(__cfg, prop) === false) {
			log_warn('Unknown configuration property', prop);
		}
		let x = {};
		obj_setProperty(x    , prop, args[1]);
		obj_setProperty(__cfg, prop, args[1]);
		listeners_emit('config', x);
		return;
	}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:29,代码来源:config.ts

示例2: function

 return function(val){
     if (current_ === val) {
         return;
     }
     current_ = val;
     obj_setProperty(ctr, property, val);
 };
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:bind.ts

示例3: compo_attach

export function compo_attach (compo: Component, name: string, fn: Function) {
    var current = obj_getProperty(compo, name);		
    if (is_Function(current)) {
        var wrapper = function(){
            var args = _Array_slice.call(arguments);
            fn.apply(compo, args);
            current.apply(compo, args);
        };
        obj_setProperty(compo, name, wrapper);
        return;
    }
    if (current == null) {
        obj_setProperty(compo, name, fn);
        return;
    }
    throw Error('Cann`t attach ' + name + ' to not a Function');
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:17,代码来源:compo.ts

示例4: builder_setCompoProps

export function builder_setCompoProps(compo, node, model, ctx, container) {
    var props = node.props;
    if (props == null) {
        return;
    }
    for (var key in props) {
        var val = props[key];
        var x = is_Function(val)
            ? val('compo-prop', model, ctx, container, compo, key)
            : val;
        obj_setProperty(compo, key, x);
    }
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:13,代码来源:util.ts

示例5: function

	registerExport_: function(ctr, exportName, name, alias){
		var module = this.module;
		var prop = alias || name;
		var obj = null;
		if (this.async === 'async' && module.isBusy()) {
			var dfr = new class_Dfr;
			var that = this;
			module.then(
				function(){
					var val = module.getExport(name);
					if (val == null) {
						that.logError_('Exported property is undefined: ' + name);
					}
					dfr.resolve(val);
				},
				function (error) {
					dfr.reject(error)
				}
			);
			obj = dfr;
		} else {
			obj = module.getExport(name);
		}
		if (obj == null) {
			this.logError_('Exported property is undefined: ' + name);
			return;				
		}
		if (name === '*' && _opts.es6Modules && obj.default != null) {
			var defaultOnly = true;
			for (var key in obj) {
				if (key === 'default' || key[0] === '_') continue;
				defaultOnly = false;
				break;
			}
			if (defaultOnly) {
				warn_withNode('Default ONLY export is deprecated: `import * as foo from X`. Use `import foo from X`', this.node);
				obj = obj.default;
			}
		}

		if (ctr.scope == null) {
			ctr.scope = {};
		}
		if (exportName === '*') {
			throw new Error('Obsolete: unexpected exportName');
		}
		this.imports[exportName] = obj;
		obj_setProperty(ctr.scope, prop, obj);
		customTag_registerResolver(prop);
	},
开发者ID:atmajs,项目名称:MaskJS,代码行数:50,代码来源:Import.ts

示例6: function

    el_writeProps = function(el, node, props, model, ctx, container, ctr) {
        for (var key in props) {
            // if (key.indexOf('style.') === 0) {
            // 	key = prepairStyleProperty(el, key)
            // }
            var mix = props[key],
                val = is_Function(mix)
                    ? getValByFn('prop', mix, key, model, ctx, el, ctr)
                    : mix;

            if (val == null) {
                continue;
            }
            obj_setProperty(el, key, val);
        }
    };
开发者ID:atmajs,项目名称:MaskJS,代码行数:16,代码来源:build_node.ts

示例7: u_setOption

export function u_setOption (options, key, val) {
    if (key === 'base' || key === 'nsBase') {
        var path = path_normalize(val);
        if (path[path.length - 1] !== '/') {
            path += '/';
        }
        // Do not resolve root, as it will be resolved by base later
        // @NextIteration: remove also path_resolveRoot, use instead resolveCurrent
        // if (path[0] === '/') {
        // 	path = path_combine(path_resolveRoot(), path);
        // }
        options[key] = path;
        return this;
    }
    var current = obj_getProperty(options, key);
    if (is_Object(current) && is_Object(val)) {
        obj_extend(current, val);
        return this;
    }
    obj_setProperty(options, key, val);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:21,代码来源:utils.ts

示例8: function

 Component.Dom.addEventListener(el, event, function(){
     var val = expression_eval_safe(expression, model, ctx, ctr, node);
     obj_setProperty(model, ref, val);
 });
开发者ID:atmajs,项目名称:MaskJS,代码行数:4,代码来源:xToggle.ts


注:本文中的@utils/obj.obj_setProperty函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。