为了账号安全,请及时绑定邮箱和手机立即绑定

Handlebars.js:{{ this.url }} 在 <img src

Handlebars.js:{{ this.url }} 在 <img src

喵喵时光机 2021-06-29 09:35:42
如果我将它放在 / 等中,Handlebars.js 将不会解析代码。只要它在外面,它就可以正常工作。<script id="entry-template" type="text/x-handlebars-template">    <div class="entry">        {{#each this}}        <h1>{{title.rendered}}</h1>        <div>{{content.rendered}}</div>        <img src="{{url}}" alt=""/>        {{/each}}    </div></script>我希望得到<img src="http://localhost/image.jpg" alt=""/>但输出如下:<img src="{{url}}" alt=""/>其他一切似乎都有效。循环也是。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 229 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信