<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>键盘事件</title>
<script src="js/vue.js"></script>
<script type="text/javascript">
window.onload=function(){
let vm=new Vue({
el:'#itany',
data:{
},
methods:{
show(e){
console.log(e.KeyCode);
}
}
});
}
</script>
</head>
<body>
<div id="itany">
<!-- @keydown\@keypress\@keyup -->
用户名:<input type="text" @keydown="show($event)">
</div>
</body>
</html>
vue获取不到KeyCode,显示undefined,求指点
最新推荐文章于 2023-10-07 17:21:25 发布