本文整理汇总了TypeScript中@compo/exports.Component类的典型用法代码示例。如果您正苦于以下问题:TypeScript Component类的具体用法?TypeScript Component怎么用?TypeScript Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Component类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: bind
function bind (current, expr, model, ctx, element, ctr, attrName, type){
var refresher = create_refresher(type, expr, element, current, attrName, ctr),
binder = expression_createBinder(expr, model, ctx, ctr, refresher);
expression_bind(expr, model, ctx, ctr, binder);
Component.attach(ctr, 'dispose', function(){
expression_unbind(expr, model, ctr, binder);
});
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:10,代码来源:bind.ts
示例2: function
getAni: function (name) {
var x = this[name];
if (x != null) {
return x;
}
var ani = Component.child(this, 'Animation#' + name);
if (ani != null) {
return (this[name] = ani.start.bind(ani));
}
},
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:listen.ts
示例3: compo_disposeChildren
export function compo_disposeChildren (compo){
var els = compo.elements;
if (els != null) {
dom_removeAll(els);
compo.elements = null;
}
var compos = compo.components;
if (compos != null) {
var imax = compos.length, i = -1;
while (++i < imax){
Component.dispose(compos[i]);
}
compos.length = 0;
}
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:compo.ts
示例4: customAttr_register
customAttr_register('xx-visible', function(node, attrValue, model, ctx, el, ctr) {
var binder = expression_createBinder(attrValue, model, ctx, ctr, function(value){
el.style.display = value ? '' : 'none';
});
expression_bind(attrValue, model, ctx, ctr, binder);
Component.attach(ctr, 'dispose', function(){
expression_unbind(attrValue, model, ctr, binder);
});
if (expression_eval(attrValue, model, ctx, ctr, node)) {
el.style.display = 'none';
}
});
开发者ID:atmajs,项目名称:MaskJS,代码行数:16,代码来源:xxVisible.ts
示例5: compo_dispose
export function compo_dispose (compo, parent?) {
if (compo == null)
return false;
if (compo.elements != null) {
dom_removeAll(compo.elements);
compo.elements = null;
}
Component.dispose(compo);
var compos = (parent && parent.components) || (compo.parent && compo.parent.components);
if (compos == null) {
log_error('Parent Components Collection is undefined');
return false;
}
return arr_remove(compos, compo);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:17,代码来源:compo.ts
示例6: function
renderStart: function(model, ctx){
if (this.module == null) {
return;
}
var resume = Component.pause(this, ctx);
var self = this;
this
.module
.loadModule()
.done(function(){
self.nodes = self.module.exports['__nodes__'];
self.scope = self.module.scope;
self.location = self.module.location;
self.getHandler = self.module.getHandler.bind(self.module);
})
.fail(function(error){
error_withCompo(error, this);
self.nodes = self.module.source;
})
.always(resume);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:21,代码来源:components.ts
示例7: function
prepairImports_: function(){
var imports = Component.closest(this, 'imports');
if (imports != null) {
return this.importItems = imports.importItems;
}
},
开发者ID:atmajs,项目名称:MaskJS,代码行数:6,代码来源:await.ts
示例8: customTag_register
customTag_register(':validate:message', Component.create({
template: 'div.' + class_INVALID + ' { span > "~[bind:message]" button > "~[cancel]" }',
onRenderStart: function(model){
if (typeof model === 'string') {
model = {
message: model
};
}
if (!model.cancel) {
model.cancel = 'cancel';
}
this.model = model;
},
compos: {
button: '$: button',
},
show: function(message, oncancel){
var that = this;
this.model.message = message;
this.compos.button.off().on(function(){
that.hide();
oncancel && oncancel();
});
this.$.show();
},
hide: function(){
this.$.hide();
}
}));
开发者ID:atmajs,项目名称:MaskJS,代码行数:35,代码来源:validate.ts
注:本文中的@compo/exports.Component类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论