我正在使用一个插件称为ember电源选择。
Github:https://github.com/cibernox/ember-power-select
要搜索的文档:https://ember-power-select.com/docs/the-search
多个选择的文档:https://ember-power-select.com/docs/multiple-selection/
问:如何使用name
或email
进行搜索/template.hbs
<PowerSelectMultiple
@searchEnabled={{true}}
@options={{this.authors}}
@selected={{this.author}}
@searchField="email"
@placeholder="Select some names..."
@onChange={{fn (mut this.author)}} as |author|>
{{name}}
</PowerSelectMultiple>
/controller.js
authors = [
{ name: 'Foo', email: 'foo@gmail.com' },
{ name: 'Bar', email: 'bar@gmail.com'},
{ name: 'Baz' email: 'baz@gmai.com'}
]
1条答案
按热度按时间42fyovps1#
第一个
You can refer this link from Power-select DOC's
我不确定searchMethod的返回类型,您可以检查power-select lib并相应地自定义它。