本文整理汇总了TypeScript中@dojo/core/lang.assign函数的典型用法代码示例。如果您正苦于以下问题:TypeScript assign函数的具体用法?TypeScript assign怎么用?TypeScript assign使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assign函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: render
render(): DNode {
const {
forId,
label
} = this.properties;
// assign string or object label properites with defaults
let labelProps: LabelOptions;
if (typeof label === 'string') {
labelProps = assign({}, labelDefaults, { content: label });
}
else {
labelProps = assign({}, labelDefaults, label);
}
// add label text node to children
const labelText = v('span', {
innerHTML: labelProps.content,
classes: [ this.theme(css.labelText), labelProps.hidden ? baseCss.visuallyHidden : null ]
});
if (labelProps.before) {
this.children.unshift(labelText);
}
else {
this.children.push(labelText);
}
return v('label', {
classes: this.theme(css.root),
for: forId
}, this.children);
}
开发者ID:bitpshr,项目名称:widgets,代码行数:32,代码来源:Label.ts
示例2: function
const props = function(props = {}) {
return assign({
controls: 'foo',
id: 'foo',
index: 0
}, props);
};
开发者ID:dylans,项目名称:widgets,代码行数:7,代码来源:TabButton.ts
示例3: function
export const todoSave = function(this: any, event: FormInputEvent) {
const { properties } = this;
if (!event.target.value) {
deleteTodo(properties);
}
else {
updateTodo(assign({}, properties, { label: event.target.value, editing: false }));
}
};
开发者ID:Tomdye,项目名称:examples,代码行数:9,代码来源:userActions.ts
示例4: function
export const todoSave = function (this: any, event: FormInputEvent) {
const { state } = this;
if (!event.target.value) {
deleteTodo(state);
}
else {
updateTodo(assign(state, { label: event.target.value, editing: false }));
}
};
开发者ID:Tomdye,项目名称:examples,代码行数:9,代码来源:userActions.ts
示例5: assign
return this.children.filter((child) => child).map(child => {
// null checks skipped since children are filtered prior to mapping
assign(child!.properties, {
onRequestClose: this._assignCallback(child!, 'onRequestClose', this.onRequestClose),
onRequestOpen: this._assignCallback(child!, 'onRequestOpen', this.onRequestOpen),
open: includes(openKeys, child!.properties.key),
theme
});
return child;
});
开发者ID:dylans,项目名称:widgets,代码行数:11,代码来源:AccordionPane.ts
示例6: missingFile
function missingFile(path: string) {
return assign(
new Error(
`Error: ENOENT: no such file or directory stat '${path}' errno -2`
),
{
code: 'ENOENT',
errno: -2,
syscall: 'stat',
path
}
);
}
开发者ID:devpaul,项目名称:intern,代码行数:13,代码来源:nodeMocks.ts
注:本文中的@dojo/core/lang.assign函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论