本文整理汇总了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;未经允许,请勿转载。 |
请发表评论