标签:char charset method baidu eth 分享 delete com this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>-->
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="hdcms">
<!--13=enter回车 /tab/delete/esc/space(空格)/up/down/left/right-->
<!--alt/ctrl/shift 这三个键要配合其它任意键才会触发 例: @keyup.ctrl.65 (ctrl+a键触发 65是a的asci码)-->
<input type="text" v-model=‘content‘ @keyup.ctrl.65="keyEvent">
<li>{{content}}</li>
</div>
<script>
var app = new Vue({
el: ‘#hdcms‘,
data: {
content:‘‘,
},
methods: {
keyEvent(){
console.log(this.content);
}
}
});
</script>
</body>
</html>
效果:
如果是字母要用十进制的大字字母的ascii,才能对应到键盘上对应的字母键
https://baike.baidu.com/item/ASCII/309296?fr=aladdin
标签:char charset method baidu eth 分享 delete com this
原文地址:https://www.cnblogs.com/haima/p/10238194.html