本文整理匯總了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'));