问题:
当一个 form 元素中只有一个输入框时,每次鼠标点击输入框后,不管是否输入数据,按下回车键后,地址栏的URL发生改变,可能导致发生跳转
由1变成2,多了个 # 号
1:http://localhost:8080/#/information/searchIndexList
2:http://localhost:8080/?#/information/searchIndexList
(如果表单是在对话框弹窗中显示,按回车会出现直接关闭弹窗)
解决:
如果希望阻止这一默认行为,可以在标签上添加 @submit.native.prevent
<el-form ref="form" :model="form" @submit.native.prevent></el-form>