本文介绍了在htmlbars中使用es6 spread操作符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以在htmlbars中使用相当于spread操作符吗?
Is is possible to use the equivalent of the spread operator in htmlbars?
let items = ['hello', 'world'];
someFunction(...items); // equivalent to someFunction('hello', 'world');
我需要这个htmlbars
I need this in htmlbars
{{link-to 'some.route' ...items}}
推荐答案
不,这是不可能的。我相信此PR请求会尝试实施:。不幸的是,开发似乎并没有很活跃。
No, this is not possible afaik. I believe this PR request tries to implement it: https://github.com/wycats/handlebars.js/pull/1149. Unfortunately development on it doesn't seem to be very active.
这篇关于在htmlbars中使用es6 spread操作符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!