本文整理汇总了TypeScript中@core/builder/exports.builder_build函数的典型用法代码示例。如果您正苦于以下问题:TypeScript builder_build函数的具体用法?TypeScript builder_build怎么用?TypeScript builder_build使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了builder_build函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
render: function(node, model, ctx, container, ctr, children){
var run = expression_eval,
str = node.expression,
repeat = str.split('..'),
start = + run(repeat[0] || '', model, ctx, ctr),
end = + run(repeat[1] || '', model, ctx, ctr);
if (start !== start || end !== end) {
log_error('Repeat attribute(from..to) invalid', str);
return;
}
var nodes = node.nodes;
var arr = [];
var i = start - 1;
while (++i < end) {
arr.push(compo_init(
'repeat::item',
nodes,
model,
i,
container,
ctr
));
}
var els = [];
builder_build(arr, model, ctx, container, ctr, els);
arr_pushMany(children, els);
}
示例2: function
render: function(node, model, ctx, container, ctr, children){
var els = [];
builder_build(node.nodes, model, ctx, container, ctr, els);
arr_pushMany(children, els)
var visible = expression_eval(node.expression, model, ctx, ctr);
toggle(els, visible);
}
示例3: function
render: function(node, model, ctx, el, ctr, elements){
var value = expression_eval(node.expression, model, ctx, ctr),
nodes = getNodes(value, node.nodes, model, ctx, ctr);
if (nodes == null)
return;
builder_build(nodes, model, ctx, el, ctr, elements);
},
示例4: build
function build(nodes, array, ctx, container, ctr, elements?) {
var imax = array.length,
nodes_ = new Array(imax),
i = 0, node;
for(; i < imax; i++) {
node = createEachNode(nodes, i);
builder_build(node, array[i], ctx, container, ctr, elements);
}
}
示例5: build
function build(value, For, nodes, model, ctx, container, ctr, childs) {
builder_build(
getNodes(nodes, value, For[0], For[1], For[2], For[3]),
model,
ctx,
container,
ctr,
childs
);
}
示例6: compo_renderElements
export function compo_renderElements (nodes, model, ctx, el, ctr, children?){
if (nodes == null){
return null;
}
var arr = [];
builder_build(nodes, model, ctx, el, ctr, arr);
if (is_Array(children)) {
children.push.apply(children, arr);
}
return arr;
};
示例7: function
render: function(node, model, ctx, container, ctr, children){
var array = expression_eval(node.expression, model, ctx, ctr);
if (array == null)
return;
builder_build(
getNodes(node, array)
, array
, ctx
, container
, ctr
, children
);
}
示例8: function
render: function (node, model, ctx, container, ctr, els) {
var name = attr_first(node.attr);
var Compo = customTag_get(name, ctr);
var template;
if (Compo != null) {
template = Compo.prototype.template || Compo.prototype.nodes;
if (template != null) {
template = mask_merge(template, node.nodes);
}
}
else {
template = Templates.get(name);
}
if (template != null) {
builder_build(template, model, ctx, container, ctr, els);
}
}
示例9: function
render: function(node, model, ctx, el, ctr, elements){
var obj = expression_eval(
node.expression
, model
, ctx
, ctr
);
if (obj == null) {
warn_withNode('Value is undefined', node);
}
builder_build(
node.nodes
, obj
, ctx
, el
, ctr
, elements
);
}
示例10: function
progress_: function(ctx, container){
var nodes = this.progressNodes;
if (nodes == null) {
return;
}
var hasLiteral = nodes.some(function(x){
return x.type === Dom.TEXTNODE;
});
if (hasLiteral) {
nodes = jMask('div').append(nodes);
}
var node = {
type: Dom.COMPONENT,
nodes: nodes,
controller: new Component,
attr: {},
};
builder_build(node, null, ctx, container, this);
},