Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript tryhandlebarsjs寄存器辅助函数_Javascript_Handlebars.js - Fatal编程技术网

Javascript tryhandlebarsjs寄存器辅助函数

Javascript tryhandlebarsjs寄存器辅助函数,javascript,handlebars.js,Javascript,Handlebars.js,我在和你玩 我有以下功能: export const cellHelper = { name: "cell", handler: (context) => { //... return template } } 如果按原样传递,则会得到错误:语法错误:意外的令牌导出。正确的语法是什么?按如下方式传递: Handlebars.registerHelper('cell', function(context) { //...

我在和你玩

我有以下功能:

export const cellHelper = {
    name: "cell",
    handler: (context) => {
        //...
        return template
    }
}
如果按原样传递,则会得到
错误:语法错误:意外的令牌导出
。正确的语法是什么?

按如下方式传递:

Handlebars.registerHelper('cell', function(context) {
   //...
   return template
});