vue支持如下写法
但在
@keyup.enter.native
@baiyaaaaa
Cool! This works for me!
@baiyaaaaa 这个在文档的什么地方写的有? 我没找到, 谢谢
the better way to support enter to submit a form is set native-type='submit'
on el-button
component.
Muito bom isso funciona pra mim. valeu Galera! Viva a comunidade...
<el-input :placeholder="'Comente sobre isso...'" v-model="message" @keyup.enter.native="saveComment"></el-input>
in version 2.5.7 @keyup.enter="search" work
<el-input placeholder="请输入内容" v-model="input" clearable size="small" @keyup.enter.native="handleClick">
</el-input>
Just like this,it's right!!!
@baiyaaaaa 这个在文档的什么地方写的有? 我没找到, 谢谢
Vue官方文档_从 Vue 1.x 迁移_用 v-on 监听原生事件 变更
I write @keyup.native.enter
, however, it doesn't work as submit
button did, it refreshes the whole page and didn't create any post request.
你可以使用 @keypress.enter.native="submitForm('resetPasswordForm')" . Ref: https://polinwei.com/element-ui-prevent-form-submit/
I write
@keyup.native.enter
, however, it doesn't work assubmit
button did, it refreshes the whole page and didn't create any post request.
you made a mistake.It shoule be @keyup.enter.native
@keyup.enter.native
in JSX
{...{
nativeOn: {
keyup: (e) => {
if (e.keyCode === 13) {}
}
}
}}
Most helpful comment
@keyup.enter.native