当前位置: 首页>>代码示例>>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;未经允许,请勿转载。