element-ui 的el-form的问题(回车默认提交)

element-ui 的el-form的问题(回车默认提交)

element-ui的el-form的中如果只有一个input框,当按下enter键时,会默认出发提交事件,刷新页面。

解决办法:在el-form中加入@submit.native.prevent 来使提交后不刷新页面,从而解决这个问题

<el-form :model="test" size="mini" label-width=“70px” @submit.native.prevent>
.........
</el-form>

猜你喜欢

转载自blog.csdn.net/qq_40844662/article/details/107174752