代码拉取完成,页面将自动刷新
同步操作将从 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>
<body>
</body>
</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;x++)}}xxx {{~end}}";
// var testhtml = "{{~ for(var x=0,a=title;x<title.length;x++)}} 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}} {{sexString?(1)}} {{a?.b?.c?().d?}}";
// var testhtml = "{{~ var a = 100}} {{~for (var i=0;i<10;i++)}} {{~ a++}} {{~end}} {{a}}";
// var testhtml = "{{~ var a = 100}} {{~ if (a ==50) }} aaa {{~ elseif(a == 100)}} bbbb{{~end}}";
// var testhtml = " {{~ if (a ==50) }} aaa {{~ elseif(a == 100)}} bbbb{{~end}}";
// var testhtml = "{{~ for (item of Object.values(title).length(aacc) )}} {{item}} {{~end}} ";
// var testhtml = "{{~ var keys = Object.keys($data),len = title.length}} {{keys}} titlelen:{{len}} ";
// var testhtml = "{{~ var keyLen = Object.keys($data).length}} {{~ if(keyLen == 1)}} 1 {{~ else if (keyLen == 2)}} 2 {{~elseif (keyLen == 3)}} 3 {{~end}} ";
// var testhtml = '<div class="modal">' +
// ' <div class="modal-dialog modal-lg">' +
// ' <div class="modal-content shadow-lg">' +
// ' <div class="modal-header">' +
// ' <h5 class="modal-title">{{title}}</h5>' +
// ' <button type="button" class="close" data-dismiss="modal" aria-label="Close" >' +
// ' <span aria-hidden="true">×</span>' +
// ' </button>' +
// ' </div>' +
// ' <div class="modal-body" style="word-break: break-all">' +
// ' <p>{{content}}</p>' +
// ' </div>' +
// ' <div class="modal-footer">' +
// ' <button type="button" class="btn btn-secondary" data-dismiss="modal"> 关闭 </button>' +
// ' </div>' +
// ' </div>' +
// ' </div>' +
// '</div>';
// var data = {"title": "title test", "content": "content test..."};
// var fasty = new Fasty({
// share: {
// sexString: function (v) {
// console.log("sexString>>> invoked")
// return v === 0 ? '女' : '男';
// }
// },
// safelyAccess:false,//true
// });
// var testhtml = ' {{attr}} hello {{ func1(name) }} {{* "<div> hello </div>" }} --'
var testhtml = ' {{attr}} hello {{ func1(name) }} {{! "<div> hello </div>"}}'
var data = {name: "fasty"}
var fasty = new Fasty({
//the shared template data or functions
share: {
attr: 'text...',
func1: function (v) {
return v + " kiss~~"
},
}
});
console.log(fasty.render(testhtml, data))
console.log(document.body.innerHTML = fasty.render(testhtml, data))
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。