1 Star 0 Fork 0

zhengchen/avalon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index_with2.html 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
qincheng 提交于 2014-02-09 12:15 . 重命名例子
<!DOCTYPE html>
<html>
<head>
<title>ms-with</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="avalon.js"></script>
<style>
.red{
color:red;
}
.green{
color:greenyellow;
}
.aaa{
color:green;
}
</style>
<script >
var model = avalon.define("test", function(vm) {
vm.items = {
aaa: 1,
bbb: 2,
ccc: {
a: 1,
b: 1,
c: 1
}
}
})
setTimeout(function() {
console.log("==================")
model.items = {
kkk: -1,
fff: 0,
ccc: {
a: "xxx",
b: "yyy",
d: {
kkk:444
}
},
eee: 3,
bbb: "zzz"
}
}, 2000)
</script>
</head>
<body >
<div ms-controller="test">
<div ms-with="items">
<p>{{$key}}-------------------{{$val}}</p>
<ul ms-with="$val">
<li>{{$key}}:{{$val}}
<div ms-with="$val">
<h3>{{$key}}</h3>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cowboy13/avalon.git
git@gitee.com:cowboy13/avalon.git
cowboy13
avalon
avalon
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385