代码拉取完成,页面将自动刷新
同步操作将从 Michael Yang/fasty 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>fasty</title>
<script src="./fasty.js"></script>
<script src="https://unpkg.com/art-template/lib/template-web.js"></script>
</head>
<body>
<script>
// var testhtml = "a";
// var testhtml = "{{~ for(item of array)}} xxx {{~end}}";
// var testhtml = "{{~ for(item of array)}} xxx {{~ for (newItem of item.xxx)}} xxxx {{~end}} {{~end}}";
// var testhtml = "{{~ for(item of array)}} xxx {{~ for (newItem of item1.xxx)}} xxxx {{~end}} {{~end}}";
// var testhtml = "{{~ for(var x=0;x<100;i++)}} xxx {{~end}}";
// var testhtml = "{{~ for(var x=0,a=title;x<title.length;i++)}} xxx{{a}} {{~end}}";
// var testhtml = "{{~ var aaa = \"aaa\"}}";
// var testhtml = "{{~ var aaa = \"aaa\"}} {{~ for ( x of aaa)}} {{aaa}}--{{x}}--{{end1}}--end {{~end}}";
// var testhtml = "{{~ var aaa = \"aaa\"}} {{~ for ( x of aaa)}} {{aaa}}--{{x}}--{{end1}}--end {{~end}} {{x}} {{aaa}} {{bbb}}";
// var testhtml = "{{~ var aaa = \"aaa\"}} {{~ for ( x of aaa)}} {{aaa}}--{{x}}--{{end1}}--end {{~for (var i=0;i< x.length;i++)}} {{x[i]}} {{~end}} {{~end}} {{x}} {{aaa}} {{bbb}}";
// var testhtml = "{{~ var aaa = \"aaa\"}} {{~ for ( x of aaa)}} {{aaa}}--{{x}}--{{end1}}--end {{~for (var i=0;i< x.length;i++)}} {{x[i]}} {{aaa}} {{bbb}} {{~end}} {{~end}} {{x}} {{aaa}} {{bbb}}";
// var testhtml = "{{~if (a == b)}} xxx {{~end}}";
// var testhtml = "{{~ var a = \"c\"}} {{~if (a == b)}} xxx {{~end}}";
var testhtml = "{{~ var a = \"c\",b=\"c\"}} {{~if (a == b)}} xxx {{~end}}{{title}}{{content}}";
var data = {"title": "title test", "content": "content test..."};
var fasty = new Fasty();
let time1 = new Date().getTime();
for (var i = 0; i < 10000; i++) {
fasty.render(testhtml, data);
// console.log(render)
}
console.log("time1 >>>> " + (new Date().getTime() - time1))
time1 = new Date().getTime();
for (var i = 0; i < 10000; i++) {
var testhtml = "{{set a = \"c\"}} {{set b = \"c\"}} {{if a == b}} xxx {{/if}}{{title}}{{content}}";
template.render(testhtml, data);
}
console.log("time2 >>>> " + (new Date().getTime() - time1))
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。