0
我想在c#web窗體應用程序中使用像模板handlebarsjs。這是我需要呈現的模板的粗略外觀。目前我正在使用查找和替換文本來做到這一點。但它使我的代碼太雜亂,特別是在其他部分。
是否有任何模板庫可以幫助我渲染此..!handlebarsjs像模板在網絡形式
<ul>
{{#each items}}
<li>
<h1>{{post_title}}</h1>
<p>{{post_description}}</p>
<small>{{post_date}}</small>
</li>
{{/each}}
</ul>
又如:
<ul>
{{#each items}}
<li>
<h1>{{post_title}}</h1>
<p>
{{#if short-desc}}
{{post_description}}
{{#else}}
{{post_long_description}}
{{#end if}}
</p>
{{#if display-date}}
<small>{{post_date}}</small>
{{#end if}}
</li>
{{/each}}
</ul>