refactor: 优化部分 ref API 使用方式
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user