ie10下 vue input输入框的@keyup无效

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.4.4/vue.min.js"></script>
    <style>
        img{max-width:125px;}
    </style>
</head>
<body>
    <div id="app">
        <input type="text" value="tttttttttttttttttt" @keyup.enter="a">
        <button @click="b">测试</button>
    </div>
    <script>
    new Vue({
        el:"#app",
        methods:{
            a:function(){
                alert(1);
            },
            b:function(){
                alert(2);
            }
        }
    });
    </script>
</body>
</html>

输入框中按回车键
1.谷歌上弹1
2.ie浏览器弹2
:很明显ie10上,input的@keyup绑定无效,而且焦点自动转移到button上去了。
有人能解释下这个缘由吗

阅读 6.9k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题