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


TypeScript createPanel.default函數代碼示例

本文整理匯總了TypeScript中src/createPanel.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createTabbedPanel

 */
widgets.push(createWidget({
	id: 'title',
	stateFrom: widgetStore,
	tagName: 'h1'
}));

const tabbedPanel = createTabbedPanel({
	id: 'tabbed-panel',
	stateFrom: widgetStore
});

widgets.push(tabbedPanel);

const panel1 = createPanel({
	id: 'panel-1',
	stateFrom: widgetStore
});

panel1.append(createWidget({
	id: 'foo',
	stateFrom: widgetStore
}));

tabbedPanel.append(panel1);

const panel2 = createPanel({
	id: 'panel-2',
	stateFrom: widgetStore
});

panel2.append(createWidget({
開發者ID:danice,項目名稱:widgets,代碼行數:32,代碼來源:index.ts

示例2: createTabbedPanel

import createTabbedPanel from 'src/createTabbedPanel';
import createPanel from 'src/createPanel';
import createWidget from 'src/createWidget';
import projector from 'src/projector';

const tabbedPanel = createTabbedPanel();

const tab1 = createPanel({
	state: { label: 'tab 1', closeable: true }
});

tab1.append(createWidget({
	state: { label: JSON.stringify({ id: 'tab1' }) }
}));

tabbedPanel.append(tab1);

const tab2 = createPanel({
	state: { label: 'tab 2' }
});

tab2.append(createWidget({
	state: { label: JSON.stringify({ id: 'tab2' }) }
}));

tabbedPanel.append(tab2);

const tab3 = createPanel({
	state: { label: 'tab 3' }
});
開發者ID:danice,項目名稱:widgets,代碼行數:30,代碼來源:tabbedPanel.ts

示例3: createTabbedMixin

import * as registerSuite from 'intern!object';
import * as assert from 'intern/chai!assert';
import createTabbedMixin from 'src/mixins/createTabbedMixin';
import createPanel from 'src/createPanel';

registerSuite({
	name: 'mixins/ceateTabbedMixin',
	'creation': {
		'with closable tabs'() {
			const tabbed = createTabbedMixin({
				children: [
					createPanel({ state: { closeable: true, id: 'foo', label: 'foo' }}),
					createPanel({ state: { closeable: false, id: 'bar', label: 'bar' }}),
					createPanel({ state: { closeable: true, id: 'baz', label: 'baz' }}),
					createPanel({ state: { closeable: false, id: 'qat', label: 'qat' }})
				],
				state: {
					id: 'qux'
				}
			});

			const vnode = tabbed.render();
			assert.deepEqual(vnode.properties, {
				'data-widget-id': 'qux',
				classes: {},
				styles: {},
				key: tabbed
			});
			assert.strictEqual(vnode.vnodeSelector, 'dojo-panel-mixin');
			assert.strictEqual(vnode.children.length, 2, 'should have two children');
開發者ID:danice,項目名稱:widgets,代碼行數:30,代碼來源:createTabbedMixin.ts


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