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


TypeScript refs._document类代码示例

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


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

示例1: function

 _build: function(node, model, ctx, component) {
     var fragment = _document.createDocumentFragment();
     
     build(node.nodes, model, ctx, fragment, component);
     
     return fragment;
 }
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:each.ts

示例2: _renderPlaceholder

export function _renderPlaceholder(staticCompo, compo, container) {
    var placeholder = staticCompo.placeholder;
    if (placeholder == null) {
        placeholder = _document.createComment('');
        container.appendChild(placeholder);
    }
    compo.placeholder = placeholder;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:8,代码来源:utils.ts

示例3: function

    nodeRenderStart: function(expr, model, ctx, el, ctr, type, node){

        var current = expression_eval_safe(expr, model, ctx, ctr, node);

        // though we apply value's to `this` context, but it is only for immediat use
        // in .node() function, as `this` context is a static object that share all bind
        // utils
        this.element = _document.createTextNode(current);

        return (this.current = current);
    },
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:bind.ts

示例4: compo_renderChildren

export function compo_renderChildren (compo, anchor, model?){
    var fragment = _document.createDocumentFragment();
    compo.elements = compo_renderElements(
        compo.nodes,
        model || compo.model,
        compo.ctx,
        fragment,
        compo
    );
    dom_insertBefore(fragment, anchor);
    compo_inserted(compo);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:12,代码来源:compo.ts

示例5: list_sort

export function list_sort (self, array){

    var compos = self.node.components,
        i = 0,
        imax = compos.length,
        j = 0,
        jmax = null,
        element = null,
        compo = null,
        fragment = _document.createDocumentFragment(),
        sorted = [];

    for (; i < imax; i++) {
        compo = compos[i];
        if (compo.elements == null || compo.elements.length === 0) 
            continue;
        
        for (j = 0, jmax = compo.elements.length; j < jmax; j++) {
            element = compo.elements[j];
            element.parentNode.removeChild(element);
        }
    }
    
    outer: for (j = 0, jmax = array.length; j < jmax; j++) {

        for (i = 0; i < imax; i++) {
            if (array[j] === self._getModel(compos[i])) {
                sorted[j] = compos[i];
                continue outer;
            }
        }
        console.warn('No Model Found for', array[j]);
    }

    for (i = 0, imax = sorted.length; i < imax; i++) {
        compo = sorted[i];

        if (compo.elements == null || compo.elements.length === 0) {
            continue;
        }

        for (j = 0, jmax = compo.elements.length; j < jmax; j++) {
            element = compo.elements[j];

            fragment.appendChild(element);
        }
    }

    self.components = self.node.components = sorted;
    dom_insertBefore(fragment, self.placeholder);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:51,代码来源:utils.ts

示例6: function

    refresh: function() {
        var currentIndex = this.index,
            model = this.model,
            ctx = this.ctx,
            ctr = this.controller,
            switch_ = this.Switch,
            imax = switch_.length,
            i = -1;
        while ( ++i < imax ){
            var node = switch_[i].node;
            var expr = node.expression;
            if (expr == null)
                break;				
            if (expression_eval_safe(expr, model, ctx, ctr, node))
                break;
        }

        if (currentIndex === i)
            return;

        if (currentIndex != null)
            els_toggleVisibility(switch_[currentIndex].elements, false);

        if (i === imax) {
            this.index = null;
            return;
        }

        this.index = i;

        var current = switch_[i];
        if (current.elements != null) {
            els_toggleVisibility(current.elements, true);
            return;
        }

        var nodes = current.node.nodes,
            frag = _document.createDocumentFragment(),
            owner = { components: [], parent: ctr },
            els = compo_renderElements(nodes, model, ctx, frag, owner);

        dom_insertBefore(frag, this.placeholder);
        current.elements = els;

        compo_inserted(owner);
        if (ctr.components == null) {
            ctr.components = [];
        }
        ctr.components.push.apply(ctr.components, owner.components);
    },
开发者ID:atmajs,项目名称:MaskJS,代码行数:50,代码来源:if.ts

示例7: el_renderPlaceholder

export function el_renderPlaceholder (container) {
    let anchor = _document.createComment('');
    container.appendChild(anchor);
    return anchor;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:5,代码来源:utils.ts


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