本文整理汇总了TypeScript中inferno.render函数的典型用法代码示例。如果您正苦于以下问题:TypeScript render函数的具体用法?TypeScript render怎么用?TypeScript render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了render函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: render
() => render(template('Hello', {}, ' and ', 'Zoo'), container)
开发者ID:Keats,项目名称:inferno,代码行数:1,代码来源:update.spec.browser.ts
示例2: it
it('should insert to the middle', () => {
render(template(generateNodes(['c', 'd', 'e'])), container);
render(template(generateNodes(['a', 'b', 'e'])), container);
expect(container.textContent).to.equal('abe');
expect(container.firstChild.childNodes.length).to.equal(3);
});
开发者ID:Keats,项目名称:inferno,代码行数:6,代码来源:patchNonKeyedChildren.spec.browser.ts
示例3: afterEach
afterEach(() => {
render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
开发者ID:Keats,项目名称:inferno,代码行数:5,代码来源:createElement.spec.browser.ts
示例4: it
it('should render a basic component', () => {
let template = (Component, title) =>
createElement('div', null,
createElement(Component, {
title,
name: 'basic-render'
})
);
expect(() => {
render(template(null, 'abc'), container);
}).to.throw();
expect(() => {
render(template({}, 'abc'), container);
}).to.throw();
render(template(BasicComponent1, 'abc'), container);
expect(container.firstChild.firstChild.getAttribute('class')).to.equal('basic');
expect(container.firstChild.firstChild.firstChild.getAttribute('class')).to.equal('basic-render');
expect(container.firstChild.firstChild.tagName).to.equal('DIV');
expect(container.firstChild.firstChild.firstChild.tagName).to.equal('SPAN');
expect(container.firstChild.firstChild.firstChild.innerHTML).to.equal('The title is abc');
expect(() => {
render(template({}, 'abc'), container);
}).to.throw();
expect(() => render(template(BasicComponent1, {}), container)).to.throw;
render(template(BasicComponent1, []), container);
render(template(BasicComponent1, 'abcdef'), container);
expect(container.firstChild.firstChild.getAttribute('class')).to.equal('basic');
expect(container.firstChild.firstChild.firstChild.getAttribute('class')).to.equal('basic-render');
expect(container.firstChild.firstChild.tagName).to.equal('DIV');
expect(container.firstChild.firstChild.firstChild.tagName).to.equal('SPAN');
expect(container.firstChild.firstChild.firstChild.innerHTML).to.equal('The title is abcdef');
render(template(BasicComponent1, null), container);
expect(container.firstChild.firstChild.getAttribute('class')).to.equal('basic');
expect(container.firstChild.firstChild.firstChild.getAttribute('class')).to.equal('basic-render');
expect(container.firstChild.firstChild.tagName).to.equal('DIV');
expect(container.firstChild.firstChild.firstChild.tagName).to.equal('SPAN');
expect(container.firstChild.firstChild.firstChild.innerHTML).to.equal('The title is ');
render(template(BasicComponent1, undefined), container);
expect(container.firstChild.firstChild.getAttribute('class')).to.equal('basic');
expect(container.firstChild.firstChild.firstChild.getAttribute('class')).to.equal('basic-render');
expect(container.firstChild.firstChild.tagName).to.equal('DIV');
expect(container.firstChild.firstChild.firstChild.tagName).to.equal('SPAN');
expect(container.firstChild.firstChild.firstChild.innerHTML).to.equal('The title is ');
render(template(BasicComponent1, '1234'), container);
expect(container.firstChild.firstChild.getAttribute('class')).to.equal('basic');
expect(container.firstChild.firstChild.firstChild.getAttribute('class')).to.equal('basic-render');
expect(container.firstChild.firstChild.tagName).to.equal('DIV');
expect(container.firstChild.firstChild.firstChild.tagName).to.equal('SPAN');
expect(container.firstChild.firstChild.firstChild.innerHTML).to.equal('The title is 1234');
});
开发者ID:Keats,项目名称:inferno,代码行数:65,代码来源:components.spec.browser.ts
示例5: unmountComponentAtNode
function unmountComponentAtNode(
container: Element | SVGAElement | DocumentFragment
): boolean {
render(null, container);
return true;
}
开发者ID:russelgal,项目名称:inferno,代码行数:6,代码来源:index.ts
示例6: it
it('Second render (update)', () => {
render(template(null), container); // change style to null
expect(container.firstChild.firstChild.getAttribute('style')).to.be.oneOf([null, '']);
});
开发者ID:Keats,项目名称:inferno,代码行数:5,代码来源:update.spec.browser.ts
示例7: afterEach
afterEach(() => {
render(null, container);
});
开发者ID:Keats,项目名称:inferno,代码行数:3,代码来源:hooks.spec.browser.ts
注:本文中的inferno.render函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论