我正在尝试将组件构造函数传递给子组件,但是当我这样做时,我收到一条错误消息:Assertion Failed: A helper named 'parent.section' could not be found
//parent-form.js
form-component as |f|
...
child-component f=f
//child-component.js
f.group as |g|
...
//form-component.js
with (hash group=(component 'form-section-component')) as |h|
yield h
奇怪的是,如果我延迟parent.group调用,一切正常。例如:
//child-component.js
if isShowingFormSection
f.group as |g|
...
当isShowingFormSection
更改为true时,parent.group
会被调用并呈现正常。
这是否意味着模板在组件准备好之前尝试实例化组件?