78250f20 by 杨威

解决按下enter键报错

1 parent f062febb
...@@ -110,17 +110,18 @@ export default { ...@@ -110,17 +110,18 @@ export default {
110 }; 110 };
111 }, 111 },
112 created() { 112 created() {
113 },
114 mounted() {
113 let self = this; 115 let self = this;
114 document.onkeydown = function(e) { 116 document.onkeydown = function(e) {
115 //按下回车提交 117 //按下回车提交
116 let key = window.event.keyCode; 118 let key = window.event.keyCode;
117 //事件中keycode=13为回车事件 119 //事件中keycode=13为回车事件
118 if (key == 13) { 120 if (key == 13) {
119 self.onSubmit(); 121 // self.onSubmit();
120 } 122 }
121 }; 123 };
122 }, 124 },
123 mounted() {},
124 methods: { 125 methods: {
125 //重置 126 //重置
126 reset() { 127 reset() {
......