本文整理汇总了TypeScript中@dojo/framework/widget-core/interfaces.DNode类的典型用法代码示例。如果您正苦于以下问题:TypeScript DNode类的具体用法?TypeScript DNode怎么用?TypeScript DNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DNode类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
const expectedTabButtons = function(empty = false, activeIndex = 0): DNode {
if (empty) {
return v('div', {
key: 'buttons',
classes: css.tabButtons
}, [ ]);
}
return v('div', {
key: 'buttons',
classes: css.tabButtons
}, [
w(TabButton, {
active: activeIndex === 0,
closeable: undefined,
controls: '',
disabled: undefined,
id: '',
index: 0,
focus: noop,
key: '0-tabbutton',
onClick: noop,
onCloseClick: noop,
onDownArrowPress: noop,
onEndPress: noop,
onHomePress: noop,
onLeftArrowPress: noop,
onRightArrowPress: noop,
onUpArrowPress: noop,
theme: undefined,
classes: undefined
}, [ null ]),
w(TabButton, {
active: activeIndex === 1,
closeable: true,
controls: '',
disabled: true,
id: '',
index: 1,
focus: noop,
key: '1-tabbutton',
onClick: noop,
onCloseClick: noop,
onDownArrowPress: noop,
onEndPress: noop,
onHomePress: noop,
onLeftArrowPress: noop,
onRightArrowPress: noop,
onUpArrowPress: noop,
theme: undefined,
classes: undefined
}, [ 'foo' ])
]);
};
示例2: expected
h.expect(() => expected([ expectedTabButtons(true), null ], 'foo'));