當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript interfaces.DNode類代碼示例

本文整理匯總了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' ])
	]);
};
開發者ID:dojo,項目名稱:widgets,代碼行數:54,代碼來源:TabController.ts

示例2: expected

			h.expect(() => expected([ expectedTabButtons(true), null ], 'foo'));
開發者ID:dojo,項目名稱:widgets,代碼行數:1,代碼來源:TabController.ts


注:本文中的@dojo/framework/widget-core/interfaces.DNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。