【文件属性】:
文件名称:tmpl:极简JS模版引擎
文件大小:282KB
文件格式:ZIP
更新时间:2021-06-26 18:23:53
JavaScript
极简JS模版引擎 tmpl
极简js模版引擎,30行代码,支持自定义分隔符、js语法、变量直接输出等功能。
基于大牛的引擎修改:
另有一款纯原创极简js填充引擎:
源码:
(function($) {
var tmplCache={}, fnCache={}, guid=0, toString = Object.prototype.toString, compile = function( tmpl, sp ){
//默认分隔符
var f = sp || "%",
//动态创建函数,并增加数据源引用(data/my)
fn = new Function("var p=[],my=this,data=my,print=function(){p.push.apply(p,arguments);};p.push('" +
【文件预览】:
tmpl-master
----tests.html(3KB)
----LICENSE(34KB)
----template.js(2KB)
----.gitignore(3KB)
----speed()
--------test.html(12KB)
--------js()
----README.md(4KB)
----.gitattributes(483B)