README.md 964 B

save-form

背景:为保存当页搜索数据,并且不使用keepAlive

使用方法:
<saveform :model="form">
  <el-form-item prop="input">
    <el-input v-model="form.input">
  </el-form-item>
</saveform>

使用时改动较小,仅须将el-form修改为saveform即可,组件会在验证通过后自动保存当前表单数据,在reset时自动清空数据

数据保存使用的是localStorage故关闭标签后数据会自动清空

翻页保存:
<pagination
  :total.sync="rules.total"
  :page.sync="rules.page"
  :limit.sync="rules.limit"
  :page-sizes="rules.page_size"
  :sync="true"
  @pagination="getList"
/>

请按照以上示例使用翻页,添加了sync字段使用此字段才会保存翻页数据

其他:

请在@/router/notKeepAliveList中添加当页路由,保证当前页面不会keepAlive

已知问题
  1. 点击重置按钮无效 请添加noclear属性