为什么无法触发鼠标覆盖和键盘事件。
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>事件绑定测试</title>
<style type="text/css" rel="stylesheet">
body {
margin: 0;
}
.gen {
width: 100px;
height: 100px;
border: solid 0.1px #122b40;
}
.isAlive {
background-color: green;
}
</style>
</head>
<body id="map" style="width: 100%;overflow: hidden;">
<p class="gen" @hover="onhover" @keyup.enter="enter" @click="onclick"></p>
<script src="js/jquery.min.js"></script>
<script src="js/vue.js"></script>
<script type="application/javascript">
var vm = new Vue({
el: '#map',
data: {},
methods :{
onclick : function(e){
alert("click");
},
onhover : function(e){
alert("hover");
},
enter : function(e){
alert("enter");
}
}
})
</script>
</body>
</html>