<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
</style>
<script src="vue.js"></script>
<script>
window.onload=function(){
var vm=new Vue({
el:'#box',
data:{
a:'blue'
},
methods:{
show:function(){
alert(1);
}
}
});
};
</script>
</head>
<body>
<div id="box">
<input type="text" @keydown.c="show">
<input type="text" @keydown.enter="show">
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
</style>
<script src="vue.js"></script>
<script>
//ctrl->17
/*document.onkeydown=function(ev){
console.log(ev.keyCode);
};*/
window.onload=function(){
var vm=new Vue({
el:'#box',
data:{
a:'blue'
},
methods:{
show:function(){
alert(1);
}
}
});
};
</script>
</head>
<body>
<div id="box">
<input type="text" @keydown.17="show">
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style> </style>
<script src="vue.js"></script>
<script>
//ctrl->17
/*document.onkeydown=function(ev){
console.log(ev.keyCode);
};*/
Vue.directive('on').keyCodes.ctrl=17; //17起了别名叫ctrl
Vue.directive('on').keyCodes.myenter=13; window.onload=function(){
var vm=new Vue({
el:'#box',
data:{
a:'blue'
},
methods:{
show:function(){
alert(1);
}
}
});
}; </script>
</head>
<body>
<div id="box">
<input type="text" @keydown.ctrl="show">
<input type="text" @keydown.myenter="show">
<input type="text" @keydown.myenter="show | debounce 2000">
</div> </body>
</html>

最新文章

  1. JAVA 序列化
  2. 【笔记】android sdk集成的eclipse中导入项目
  3. SVN更改登录用户
  4. PHP header函数的几大作用
  5. Leetcode: Max Sum of Rectangle No Larger Than K
  6. 6. ActionBar详解
  7. Helpers\Assets
  8. Tag标签系统设计
  9. Android HAL
  10. c++ 常见问题之 vector 和数组
  11. python2.x 使用protobuf
  12. 怎用不用工具创建一个javaWeb项目
  13. servlet文件上传及下载
  14. SpringBoot系列: Spring项目异常处理最佳实践
  15. css继承属性
  16. C++实验七
  17. ORACLE结构体系篇之表空间详解.md
  18. Servlet的5种方式实现表单提交
  19. 什么是Unicode
  20. 批处理--批量打开程序&amp;批量关闭程序

热门文章

  1. axios 使用post方式传递参数,后端接受不到问题
  2. SFTP使用key文件登录
  3. kubernetes 项目
  4. 带入gRPC:对 RPC 方法做自定义认证
  5. 不要在.h文件中定义变量
  6. 【codeforces 589G】Hiring
  7. Mysql学习总结(24)——MySQL多表查询合并结果和内连接查询
  8. HDU 3415 Max Sum of Max-K-sub-sequence 单调队列题解
  9. PHP join() 函数
  10. redis作为缓存场景使用,内存耗尽时,突然出现大量的逐出,在这个逐出的过程中阻塞正常的读写请求,导致 redis 短时间不可用