实现搜索按钮、重置按钮与后端接口的对接

pull/30/head
riverflow 2 months ago
parent e64a7740c9
commit c97cd4c600

@ -31,17 +31,18 @@ export default function useUserTable() {
}
}
// 获取show方法
const tableShowBtn = ref<{ show: (title: string) => void }>()
// 搜索按钮
const searchBtn = () => {
getList()
}
// 重置按钮
const resetBtn = () => {
tableShowBtn.value?.show("重置")
listParm.currentPage = 1;
listParm.name = ''
listParm.phone = ''
getList()
}
// 在组件挂载时加载数据
@ -67,7 +68,6 @@ export default function useUserTable() {
}
// 将表格查询的方法返回出去
return {
tableShowBtn,
listParm,
getList,
searchBtn,

@ -52,7 +52,6 @@
<!-- 新增编辑按钮弹框 -->
<AddUser ref="showBtn"></AddUser>
<AddUser ref="tableShowBtn"></AddUser>
</template>
<script setup lang="ts">
@ -66,8 +65,7 @@ import useUserTable from '@/compositions/user/useUserTable';
import { onMounted } from 'vue';
//
const { tableShowBtn,
listParm,
const { listParm,
getList,
searchBtn,
resetBtn,

Loading…
Cancel
Save