avalon2
Version:
an elegant efficient express mvvm framework
35 lines (30 loc) • 697 B
HTML
<html>
<head>
<title>test</title>
<meta charset="UTF-8">
<script src="../../dist/avalon.js"></script>
</head>
<body>
<div ms-controller="test">
<div>
<div :for="el in ##data" :click="@alert(el)">
{{el}}
</div>
</div>
<button type="button" :click='@sort'>click</button>
</div>
<script>
var vm = avalon.define({
$id: "test",
data: [11,22,333,444],
alert:function(el){
console.log(el)
},
sort: function(){
vm.data.reverse()
}
});
</script>
</body>
</html>