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

A Byte of Python

A Byte of Python

Swaroop C H / Lulu Marketplace / 2008-10-1 / USD 27.98

'A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save t......一起来看看 《A Byte of Python》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

随机密码生成器
随机密码生成器

多种字符组合密码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具