【发布时间】:2020-01-30 03:52:29
【问题描述】:
我有一个字符串数组作为参数传递给组件,在组件内部我使用“每个”帮助器来呈现文本输入中的每个字符串。我尝试了以下方法。
MainComponent.hbs
<Component @model={{model}}/>
//Eg: model.list = ["Jack", "Sparrow"];
Component.hbs
<div>
{{#each this.args.model.list as |name|}}
<div>
<PaperInput @value={{ name }}
@placeholder="Enter a Name"
@onChange={{action (mut name)}}/>
</div>
{{/each}}
</div>
我遇到了错误“Uncaught (in promise) Error: Assertion Failed: You can only pass a path to mut”。如果有人能告诉我这里出了什么问题,我将不胜感激。
【问题讨论】:
标签: ember.js ember-cli ember-octane