本文整理汇总了TypeScript中@ember/object.setProperties函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setProperties函数的具体用法?TypeScript setProperties怎么用?TypeScript setProperties使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setProperties函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: onChange
/**
* When user selects an item from the list
*/
onChange(selected: string): void {
if (selected && selected.trim().length > 0) {
setProperties(this, {
text: selected,
inputText: selected
});
this.onSearch(selected);
}
}
开发者ID:alyiwang,项目名称:WhereHows,代码行数:12,代码来源:search-box.ts
示例2: onFocus
/**
* When the input transitioned from blur->focus
* Restore inputText value from text, open suggestions, and search latest term
*/
onFocus(pws: IPowerSelectAPI<string>): void {
setProperties(this, {
inputText: this.text,
powerSelectApi: pws
});
if (this.text) {
pws.actions.search(this.text);
pws.actions.open();
}
}
开发者ID:alyiwang,项目名称:WhereHows,代码行数:14,代码来源:search-box.ts
示例3: async
const getBaseTest = async (test: ISearchBoxTestContext, override: ISearchBoxContract | {} = {}) => {
const props: ISearchBoxContract = {
placeholder: 'this is my placeholder',
text: undefined,
onTypeahead: async () => [],
onSearch: () => {},
...override
};
setProperties(test, props);
await render(hbs`
{{#search/search-box
placeholder=(readonly placeholder)
text=(readonly text)
onTypeahead=(action onTypeahead)
onSearch=(action onSearch) as |suggestion|}}
{{suggestion}}
{{/search/search-box}}
`);
return props;
};
开发者ID:alyiwang,项目名称:WhereHows,代码行数:23,代码来源:search-box-test.ts
示例4: run
let ret = run(function() {
return setProperties(context, hash);
});
开发者ID:switchfly,项目名称:ember-test-helpers,代码行数:3,代码来源:setup-context.ts
注:本文中的@ember/object.setProperties函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论