未古其人

目录

重置按钮

一般情况下,重置按钮直接照搬框架代码即可。

但如果是默认搜索是带有参数的,但是这个参数没有在查询框中表现出来的的,需要注意:

1. 在 JeegcListMixin 中添加 searchResetWithParams 方法。

    searchResetWithParams () {
      this.resetParams();
      this.loadData(1);
    },

2. 把所在页面的重置按钮的 searchReset 修改为 searchResetWithParams

3. 在所在页面的 methods 块中,添加 resetParams 方法来手动恢复参数

否则,自带的参数将会被清空,出现不可预料的查询结果。

<a-button type="primary" @click="searchResetWithParams" icon="reload" style="margin-left: 8px">重置</a-button>


    methods: {
      resetParams () {
        this.queryParam.dataId = this.record.dataId;
      }
    }