用on绑定事件, 父item没问题,但子item响应时, 父也响应tap, 如何解决让他们各自响应?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/mui.min.css" />
<title>test artTemplate</title>
</head>
<body>
<div class="mui-content">
<ul id="locoList" class="mui-table-view">
<li class="mui-table-view-cell mui-collapse locoItem">
<a href="#" class="mui-navigate-right">
Parent
<span class="mui-badge mui-badge-success">22</span>
</a>
<div class="mui-collapse-content">
<ul id="trainList" class="mui-table-view">
<li class="mui-table-view-cell mui-media trainItem">
<a href="#" class="mui-navigate-right">
Children
<span class="mui-badge mui-badge-success">22</span>
</a>
</li>
</ul>
</div>
</li>
</ul>
</div>
</script>
<script type="text/javascript" src="js/mui.min.js"></script>
<script src="js/template.js"></script>
<!--<script src="js/locoList.js"></script>-->
<script>
mui.init({
swipeBack: true //启用右滑关闭功能
});
mui("#locoList").on('tap', '.locoItem', function() {
console.log("locoList click item");
});
mui("#trainList").on('tap', '.trainItem', function() {
console.log("trainItem click item");
});
</script>
</body>
</html>