$self $index $first $last parent() outerParent()

1947 단어 index
index5.html
<html>
<head>
<title>$self $index $first $last parent() outerParent()</title>
<script src="jquery-1.11.2.min.js"></script>
<script src="groot.js"></script>
</head>
<body>
<div gt-view="myview">
<ul gt-each="list">
<li gt-attr="$index(id,value +1)"><span gt-text="{$index}+1"></span><span> :</span><span
gt-text="{name}"></span>---<span> :</span><span
gt-text="{sex}"></span><input
type="{text}" gt-value-change="name"/><input type="button" value=" " gt-click="click"></li>
</ul>
</div>
</body>
</html>
<script>
groot.view("myview", function (vm, ve) {
vm.list = [
{"name": " ", "sex": " "}
, {"name": " ", "sex": " "}
, {"name": " ", "sex": " "}
];
ve.click = function ($self) {
groot.log($self);//$self vm
groot.log($self.$index);//$index
groot.log($self.$first);//$first true false
groot.log($self.$last);//$first true false
groot.log($self.parent());//
groot.log($self.outerParent());// vm
}
})
</script>
$self vm
$index   
$first     true   false
$last     true   false
parent()     
outerParent()); vm 

좋은 웹페이지 즐겨찾기