【发布时间】:2017-08-10 14:51:21
【问题描述】:
我对 ember-power-select 有一个小问题。在表单中,我想将值设置为 Logical 或 Physical,因此我决定使用 ember-power-select。它工作正常,但是当我使用 ember-power-select 更改表单上的值时,显示仍然相同,我的意思是我停留在 Logical 上,即使该值为 物理。
这是模板:
{{#form.element label=(t 'type')}}
{{#power-select
selected=selectedType
searchEnabled=false
options=allType
onchange=(action (mut zone.type))
placeholder=(t 'type_zone')
as |type|}}
{{/power-select}}
{{/form.element}}
这是组件:
allType: ['Logical', 'Physical'],
selectedType: 'Logical'
还有模特:
type: DS.attr('string')
与此电源选择相关的所有内容都在这里。
【问题讨论】:
标签: ember.js ember-data display