是否可以在带有把手的选项哈希中嵌套助手? [英] Is it possible to nest helpers inside the options hash with handlebars?

查看:8
本文介绍了是否可以在带有把手的选项哈希中嵌套助手?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,有没有办法将我的i18n"助手嵌套在另一个助手的哈希变量中?

For instance, is there a way to nest my "i18n" helper inside another helper's hash variable?

{{view "SearchView" placeholder="{{t 'search.root'}}" ref="search" url="/pages/search" className='home-search'  polyfill=true}}

推荐答案

更新: Handlebars 现在支持 子表达式,所以你可以这样做:

Update: Handlebars now supports subexpressions, so you can just do:

{{view "SearchView" (t 'search.root')}}

这篇关于是否可以在带有把手的选项哈希中嵌套助手?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆