Commit 8608f28 1 parent f7b7339 commit 8608f28 Copy full SHA for 8608f28
File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 16
16
// under the License.
17
17
18
18
<template >
19
- <div class =" form-layout" v-ctrl-enter = " handleSubmit " >
19
+ <div class =" form-layout" >
20
20
<a-spin :spinning =" loading" >
21
21
<a-alert type =" warning" >
22
22
<template #message >{{ $t('message.action.start.instance') }}</template >
93
93
<template #label >
94
94
<tooltip-label :title =" $t('label.considerlasthost')" :tooltip =" apiParams.considerlasthost.description" />
95
95
</template >
96
- <a-switch v-model:checked =" form.considerlasthost" />
96
+ <a-switch v-model:checked =" form.considerlasthost" v-focus = " true " />
97
97
</a-form-item >
98
98
</div >
99
99
@@ -151,6 +151,12 @@ export default {
151
151
this .fetchHosts ()
152
152
}
153
153
},
154
+ mounted () {
155
+ document .addEventListener (' keydown' , this .handleKeyPress )
156
+ },
157
+ beforeUnmount () {
158
+ document .removeEventListener (' keydown' , this .handleKeyPress )
159
+ },
154
160
methods: {
155
161
initForm () {
156
162
this .formRef = ref ()
@@ -264,6 +270,12 @@ export default {
264
270
},
265
271
closeAction () {
266
272
this .$emit (' close-action' )
273
+ },
274
+ handleKeyPress (event ) {
275
+ event .preventDefault ()
276
+ if ((event .code === ' Enter' || event .code === ' NumpadEnter' ) && event .ctrlKey === true ) {
277
+ this .handleSubmit (event )
278
+ }
267
279
}
268
280
}
269
281
}
You can’t perform that action at this time.
0 commit comments