【问题标题】:How to using other Jquery template tags inside {{tmpl}} tag如何在 {{tmpl}} 标签中使用其他 Jquery 模板标签
【发布时间】:2011-08-28 23:09:54
【问题描述】:

我无法调用{{tmpl}} 中的任何其他模板标签。看起来解析器无法识别传递给{{tmpl}} 标记的其他标记。

例如:

{{tmpl(Students) '<span>${$data.Name}</span>'}}

有人可以告诉我上面的例子是否合法吗?

【问题讨论】:

    标签: jquery jquery-templates


    【解决方案1】:

    语法是

    {{tmpl( [data], [options] ) template}} content {{/tmpl}}
    

    其中templateThe HTML markup or text to use as a template.,这意味着您很可能无法做到这一点。我不知道这是否重要,但您可以尝试像在示例中看到的那样使用双引号,因为单引号以不评估嵌入变量而闻名...

    【讨论】:

      猜你喜欢
      • 2015-03-28
      • 1970-01-01
      • 2014-03-20
      • 1970-01-01
      • 1970-01-01
      • 2022-11-25
      • 2022-01-14
      • 2015-02-27
      • 1970-01-01
      相关资源
      最近更新 更多