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


TypeScript maquette.createProjector函數代碼示例

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


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

示例1: h

			h('li', { classes: { active: closed }, key: panel2 }, [ h('div.tab-label', [ 'tab 2' ]), h('div.tab-close', [ 'X' ]) ]),
			h('li', { classes: { active: false }, key: panel3 }, [ h('div.tab-label', [ 'tab 3' ]), h('div.tab-close', [ 'X' ]) ]),
			closed
				? undefined
				: h('li', { classes: { active: !closed }, key: panel4 }, [ h('div.tab-label', [ 'tab 4' ]), h('div.tab-close', [ 'X' ]) ])
		]),
		h('div.panels', [
			undefined,
			closed
				? h('dojo-panel', { classes: { visible: true }, key: panel2 }, [ h('div#bar', [ 'tab 2' ]) ])
				: undefined,
			undefined,
			closed
				? undefined
				: h('dojo-panel', { classes: { visible: true }, key: panel4 }, [ h('div#bar', [ 'tab 4' ]) ])
		])
	]);
}

const projector = createProjector({});

projector.append(document.body, render);

const next = document.getElementById('next');

next.addEventListener('click', (event) => {
	closed = true;
	projector.scheduleRender();
});

開發者ID:novemberborn,項目名稱:widgets,代碼行數:29,代碼來源:scratch.ts

示例2: document

		},

		get document(): Document {
			const projectorData = projectorDataMap.get(this);
			return projectorData && projectorData.root && projectorData.root.ownerDocument;
		},

		get state(): ProjectorState {
			const projectorData = projectorDataMap.get(this);
			return projectorData && projectorData.state;
		}
	})
	.mixin({
		mixin: createParentMixin,
		initialize(instance: Projector, options: ProjectorOptions) {
			const projector = createMaquetteProjector({});
			const root = options && options.root || document.body;
			projectorDataMap.set(instance, {
				projector,
				root,
				state: ProjectorState.Detached
			});
			if (options && options.autoAttach) {
				instance.attach(options && options.append);
			}
		},
		aspectAdvice: {
			after: {
				clear(): void {
					const projector: Projector = this;
					projector.invalidate();
開發者ID:kitsonk,項目名稱:widgets,代碼行數:31,代碼來源:projector.ts


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