富逻辑的模板引擎 xtemplate.js

码农软件 · 软件分类 · 模板引擎 · 2019-08-23 09:29:01

软件介绍

xtemplate 是独立的富逻辑模板引擎,基于浏览器和 Node.js 的可扩展的模板引擎库。

xtemplate 支持异步控制和继承,包括逻辑表达式,自定义函数等等。

xtemplate 语法类似 mustache

示例:

<!-- index.xtpl -->

{{extend ("./layout1")}}

{{#block ("head")}}
<!--index head block-->
<link type="text/css" target="_blank"  rel="nofollow" href="test.css" rev="stylesheet" rel="stylesheet"  />
{{/block}}

{{#block ("body")}}
<!--index body block-->
<h2>{{title}}</h2>
{{/block}}

<!-- layout1.xtpl -->

<!doctype html>
<html>
<head>
<meta name="charset" content="utf-8" />
<title>{{title}}</title>
{{{block ("head")}}}
</head>
<body>
{{{include ("./header")}}}
{{{block ("body")}}}
{{{include ("./footer")}}}
</body>
</html>



具体用法参考:https://github.com/yiminghe/xtemplate-on-browser

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

分布式算法导论

分布式算法导论

特尔 (Gerard Tel) / 电子工业出版社 / 2003-7 / 59.00

《分布式算法导论(第2版)(英文版)》由电子工业出版社出版。一起来看看 《分布式算法导论》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

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

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具