本文整理匯總了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();
});
示例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();