Ember.js 使用“时如何将参数/属性传递给EmberJs中的组件”;作为「;操作人员
在.hbs文件中,我有一个这样调用组件的结构Ember.js 使用“时如何将参数/属性传递给EmberJs中的组件”;作为「;操作人员,ember.js,handlebars.js,Ember.js,Handlebars.js,在.hbs文件中,我有一个这样调用组件的结构 {{#myComponent as |section|}} {{#if (eq section "section1")}} this is the content for the first section <br> {{else if (eq section "section2")}} Some content for section two <br> More content fo
{{#myComponent as |section|}}
{{#if (eq section "section1")}}
this is the content for the first section <br>
{{else if (eq section "section2")}}
Some content for section two <br>
More content for second section <br>
{{/if}}
{{/myComponent}}
生成时会导致分析错误
在这种情况下,我如何传递组件访问的参数
提前谢谢 认为必须使用整个组件对象,然后使用“as”关键字。像这样
{{#myComponent param1="xyz" param2=true as |section|}}
我认为必须使用整个组件对象,然后“as”关键字紧跟其后。像这样
{{#myComponent param1="xyz" param2=true as |section|}}