1 Star 1 Fork 0

ereddate / jquery-ptemplatejs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jquery.mvc.html 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
ereddate 提交于 2017-07-26 11:01 . Upload ptemplate.js jquery.mvc.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<title>ptemplatejs demo</title>
<style>
body {
background: #f4f5f7;
font-family: 微软雅黑;
}
body, ul, p {
list-style: none;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<div p-template="test">
<h1>{{title}}</h1>
<a href="#" p-handle:click="handleAClick">{{title}}</a>
<a href="#" p-router:href="/test?a=1">{{title}}1</a>
<input type="text" value="{{title}}" p-handle:change="handleInputChange" />
</div>
<script src="jquery.js"></script>
<script src="ptemplate.js"></script>
<script>
jQuery.setBaseFontSize(16);
jQuery.router({
"/test": function(e, args){
console.log(args)
}
}).renderDom("test", {
title: "test",
handle: {
handleAClick: function(e) {
e.preventDefault();
console.log(e)
jQuery.updateDom("test", {
title: "test_" + 1
})
},
handleInputChange: function(e) {
jQuery.updateDom("test", {
title: this.value
})
}
}
}, function() {
console.log("end")
});
</script>
</body>
</html>
JavaScript
1
https://gitee.com/ereddate2017/jquery-ptemplatejs.git
git@gitee.com:ereddate2017/jquery-ptemplatejs.git
ereddate2017
jquery-ptemplatejs
jquery-ptemplatejs
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891