|
4 年之前 | |
---|---|---|
.. | ||
README.md | 4 年之前 | |
index.vue | 4 年之前 |
背景:为保存当页搜索数据,并且不使用keepAlive
<saveform :model="form">
<el-form-item prop="input">
<el-input v-model="form.input">
</el-form-item>
</saveform>
使用时改动较小,仅须将el-form
修改为saveform
即可,组件会在验证通过后自动保存当前表单数据,在reset时自动清空数据
数据保存使用的是sessionStorage
故关闭标签后数据会自动清空
<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