【问题标题】:Using the es6 spread operator in htmlbars在 htmlbars 中使用 es6 扩展运算符
【发布时间】:2016-04-23 09:26:38
【问题描述】:

是否可以在 htmlbars 中使用等价的扩展运算符?

let items = ['hello', 'world'];
someFunction(...items); // equivalent to someFunction('hello', 'world');

我在 htmlbars 中需要这个

{{link-to 'some.route' ...items}}

【问题讨论】:

    标签: ember.js


    【解决方案1】:

    不,这是不可能的。我相信这个 PR 请求试图实现它:https://github.com/wycats/handlebars.js/pull/1149。不幸的是,它的开发似乎不是很活跃。

    【讨论】:

    • 好的,我实际上让这个特定的场景正常工作,因为链接到支持params 属性。 {{link-to params=myParams}}.
    猜你喜欢
    • 1970-01-01
    • 2019-06-15
    • 2018-02-25
    • 1970-01-01
    • 1970-01-01
    • 2017-05-14
    • 2018-12-13
    • 2018-06-09
    相关资源
    最近更新 更多