gpt4 book ai didi

ember.js - 如何在 ember js 中使用 {{Yield}} helper 和 hash helper?

转载 作者:行者123 更新时间:2023-12-02 06:01:59 26 4
gpt4 key购买 nike

有人可以用 yield helper with hash 的例子来解释一下吗?

最佳答案

在您的 template.hbs 中实现 yield:

{{yield (hash
foo=(component "path/to/component/foo")
bar=(component "path/to/component/bar")
)}}

你可以像这样实例化它:

{{#baz
as |x|
}}
{{x.foo}}
{{x.bar}}
{{/baz}}

希望对您有所帮助!

关于ember.js - 如何在 ember js 中使用 {{Yield}} helper 和 hash helper?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52835270/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com