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://www.codercto.com/soft/d/13025.html

The Little Schemer - 4th Edition

The Little Schemer - 4th Edition

Daniel P. Friedman、Matthias Felleisen / The MIT Press / 1995-12-21 / USD 40.00

This delightful book leads you through the basic elements of programming in Scheme (a Lisp dialect) via a series of dialogues with well-chosen questions and exercises. Besides teaching Scheme, The Lit......一起来看看 《The Little Schemer - 4th Edition》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

SHA 加密
SHA 加密

SHA 加密工具