项目中用的element-ui是v1.4.3版本

实现的功能是在input中输入查询的名称,按下键盘回车键,可以查询表格中数据

问题是,我输入名称,按下回车,会整个表单刷新,搜索条件也被清空;代码如下:

 <sc-form-layout class="sc-box-content sc-box-conten-search">
<sc-form-layout-row>
<sc-form-layout-col>
<el-form :model="queryConditions" >
<sc-form-layout>
<sc-form-layout-row>
<sc-form-layout-col></sc-form-layout-col>
<sc-form-layout-col width="standard">
<el-form-item label="">
<el-input v-model="queryConditions.fileName" auto-complete="off"
icon="search" placeholder="请输入报告名称/文件名称"
:on-icon-click='onQuery' @keyup.native.enter='onQuery'
></el-input>
</el-form-item>
</sc-form-layout-col>
<sc-form-layout-col align="right" style="width:6%;min-width: 180px;">
<el-button type="primary" @click="onQuery" v-cloak>{{actions.query.text}}</el-button>
<el-button @click="onReset" v-cloak>{{actions.reset.text}}</el-button>
</sc-form-layout-col>
</sc-form-layout-row>
</sc-form-layout>
</el-form>
</sc-form-layout-col>
</sc-form-layout-row>
</sc-form-layout>

查询方法没什么问题,后来查到是当我按下回车的时候,触发了表单的submit事件,然后整个表单就会被刷新,解决方法:

中加上 onSubmit="return false" 变成 这样就可以了

最新文章

  1. 修改sys密码与nbu备份脚本密码后,nbu备份报密码无效
  2. 360极速浏览器使用postman
  3. RedHat6.2 下RRDTool安装方法
  4. 020ARM家族
  5. 玩耍Hibernate之缓存
  6. 21世纪C语言(影印版)
  7. jQuery 遍历用法
  8. 【JDBC】百万数据插入
  9. SSDT Hook结构
  10. java.lang.Exception: Socket bind failed 服务器端口冲突--&gt;修改端口
  11. 在unity的scene中画五角星
  12. c# 自定义数据类型
  13. app端性能测试笔记
  14. Traefik实现Kubernetes集群服务外部https访问
  15. Algorithm --&gt; Dijkstra和Floyd最短路径算法
  16. AWS EC2实例Ubuntu系统设置root用户密码并使用root/ubuntu用户登录
  17. Visitor模式和Observer观察者模式
  18. # 20155337《网络对抗》Exp7 网络欺诈防范
  19. IIS、Asp.net 编译时的临时文件路径
  20. STM32 PWM输出(映射)

热门文章

  1. 语义分割Semantic Segmentation研究综述
  2. GDAL VS2010 win7(64位)安装、使用说明(图文解析)
  3. How React Works (一)首次渲染
  4. django第四课 标签的用法(if/else、for、ifequal、过滤器、注释等)
  5. ActiveMQ学习--001--ActiveMQ和消息中间件
  6. 第8章—使用Spring Web Flow—Spring Web Flow的配置
  7. 常用CSS实例
  8. Chapter 3 Phenomenon——13
  9. NMS—卷积神经网络
  10. Hadoop网站日志数据清洗——正则表达式实现