Jsrender with space

主宰稳场 提交于 2019-12-12 05:25:04

问题


Hi this code not working becouse of the space between, Peter __ Mark, how can i acchieve this with space? The code is, x-jsrender

    <div class="node">

 {{if title == 'Peter Mark'}}
 <div><a href= {{>id}} >{{>title}}</a><br />{{>subtitle}}</div>
 {{else title == 'VD'}}
  <div><a href= {{>id}} >{{>title}}</a><br />{{>subtitle}}</div> 
  {{else}}
   <div><a href='#'>{{>title}}</a><br />{{>subtitle}}</div>
  {{/if}}

回答1:


The problem is that there is an error in the template. <a href= {{>id}} > should be <a href='{{>id}}'>.

As to {{if title == 'Teamledare Redovisning'}} that will work fine. Not an issue with JsRender at all.

BTW I would usually write the above as {{if title==='Teamledare Redovisning'}}. The extra white space you have makes it harder to parse - though it will work fine. Similarly I would write {{else title==='VD'}}.



来源:https://stackoverflow.com/questions/22169207/jsrender-with-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!