- 修饰符 `.s `
- 通过事件对象中的ctrlKey的值做判断
<input type="text" @keydown.s = "show2($event)">
<script>
new Vue({
el:"#app",
data:{
htmlStr: "<h3>h3标签</h3>",
textStr:'text文本',
flag:true
},
methods:{
show2(e){
if(e.ctrlKey == true){
console.log("键盘触发");
}
}
}
})
</script>