【发布时间】:2016-09-30 21:57:42
【问题描述】:
我想要这样的事情:
{{component-one title=(component-two paramX paramY)}}
组件助手在这里不起作用,我试过了
{{component-one title=(component 'component-two' params)}}
我还尝试制作一个助手来渲染我的组件,但失败了。似乎我找到的所有答案都像这个一样过时了 how can I invoke an ember component dynamically via a variable?
更具体地针对我的用例。我使用 tooltipster 并希望通过按钮 init 呈现工具提示。
{{#tool-tipster title=(my-comp params) ... }}
------更新------
问题是,我最终需要一个带有按钮和数据余烬动作的标题的 HTML 字符串。我不能使用包装组件的 tpl。如果我扩展工具提示器,它看起来像这样:
export default TooltipsterComponent.extend({
title: 'title as html string'
//other tooltipster options go here with "optionname: optionvalue"
});
所以我已经想到了这样的事情:
title: function() {
//load component and return rendered component by hand
}}
但这让我回到了我无法手动渲染任何组件的问题。
感谢每一个输入!
干杯 圆周率
----- 更新 -------
gitbub 上的 altrim 为我的问题提供了确切的解决方案:https://github.com/altrim/tooltipster-content-component
【问题讨论】: