小编Mik*_*uel的帖子

如何使用 ember-power-select 搜索姓名或电子邮件

我正在使用一个名为 ember-power-select 的插件。

Github: https: //github.com/cibernox/ember-power-select

用于搜索的文档:https ://ember-power-select.com/docs/the-search

多项选择的文档:https ://ember-power-select.com/docs/multiple-selection/

问题:如何使用nameor进行搜索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>
Run Code Online (Sandbox Code Playgroud)

/controller.js

 authors = [
    { name: 'Foo', email: 'foo@gmail.com' },
    { name: 'Bar', email: 'bar@gmail.com'},
    { name: 'Baz' email:  'baz@gmai.com'}
  ]
Run Code Online (Sandbox Code Playgroud)

ember.js ember-data ember-cli

0
推荐指数
1
解决办法
239
查看次数

标签 统计

ember-cli ×1

ember-data ×1

ember.js ×1