refactor: 优化部分 ref API 使用方式

This commit is contained in:
2024-03-11 22:17:36 +08:00
parent e9d3865892
commit e6fa9f60a9
21 changed files with 116 additions and 80 deletions

View File

@@ -4,7 +4,8 @@
import checkPermission from '@/utils/permission';
const { proxy } = getCurrentInstance() as any;
const queryFormRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const total = ref(0);
const loading = ref(false);
@@ -63,7 +64,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -102,7 +103,7 @@
<div class="header">
<!-- 搜索栏 -->
<div class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="nickname" hide-label>
<a-input
v-model="queryParams.nickname"