本文整理汇总了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({
示例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' }
});
示例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');