JavaScript 模版引擎 JsHtml

码农软件 · 软件分类 · 模板引擎 · 2019-08-23 21:13:12

软件介绍

JsHtml 提供简洁的 HTML、全 JavaScript 的模版引擎,灵感来自 ASP.NET MVC 中的 razor 视图引擎。可在浏览器使用,也支持 Node.js 。

示例模版 index.jshtml:

<html>
<head>
    <title>@locals.title</title>
</head>

<body>

<ul class="Task">
    @locals.taskList.forEach(function(task, index) {
        <li class="@(index % 2 ? "Odd" : "Even")">
            @tag('a', {href: '/task/' + task.id}, task.name)
        </li>
    });
</ul>

<ul class="Task">
    @for(var taskIndex = 0, taskCount = locals.taskList.length; taskIndex < taskCount; taskIndex ++){
        writePartial('task', {taskIndex: taskIndex, task: locals.taskList[taskIndex]});
    }
</ul>

<p>
if you like it, let me know!<br />
- <a target="_blank"  rel="nofollow" href="mailto:elmerbulthuis@gmail.com">elmerbulthuis@gmail.com</a><br />
</p>

</body>
</html>

本文地址:https://codercto.com/soft/d/13025.html

Real-Time Collision Detection

Real-Time Collision Detection

Christer Ericson / CRC Press / 2004-12-22 / USD 98.95

Written by an expert in the game industry, Christer Ericson's new book is a comprehensive guide to the components of efficient real-time collision detection systems. The book provides the tools and kn......一起来看看 《Real-Time Collision Detection》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具