1 Star 0 Fork 0

Hanley / study-front

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
19th.html 1022 Bytes
一键复制 编辑 原始数据 按行查看 历史
hanley 提交于 2018-07-01 12:55 . vue componets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>键盘事件</title>
<script src="vue.js"></script>
</head>
<script>
window.onload = function(){
new Vue({
el:'#my',
methods:{
mykeydown:function(){
console.log('111');
}
}
});
}
</script>
<body>
<div id="my">
<!-- 键盘事件-->
<input @keydown.13="mykeydown" value="enter" />
<input @keydown.enter="mykeydown" value="enter" />
<input @keydown.a="mykeydown" value="a" />
<input @keydown.esc="mykeydown" value="esc" />
<input @keydown.left="mykeydown" value="left" />
<!--组合键-->
<input @keydown.alt.67="mykeydown" value="alt+c" />
<input @keydown.alt.c="mykeydown" value="alt+c" />
</div>
</body>
</html>
1
https://gitee.com/thanlin/study.git
git@gitee.com:thanlin/study.git
thanlin
study
study-front
master

搜索帮助