1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-05-01 06:39:01 +08:00

perf: 优化 crud query

This commit is contained in:
zclzone 2024-01-21 17:52:50 +08:00
parent 567e306a5c
commit 58de3c1ad6
4 changed files with 17 additions and 28 deletions

View File

@ -7,12 +7,8 @@
---------------------------------> --------------------------------->
<template> <template>
<AppCard <AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4">
v-if="$slots.default" <form class="flex justify-between p-16" @submit="handleSearch()">
bordered
bg="#fafafc dark:black"
class="mb-30 min-h-60 flex justify-between rounded-4 p-16"
>
<n-space wrap :size="[32, 16]"> <n-space wrap :size="[32, 16]">
<slot /> <slot />
</n-space> </n-space>
@ -21,11 +17,12 @@
<i class="i-fe:rotate-ccw mr-4" /> <i class="i-fe:rotate-ccw mr-4" />
重置 重置
</n-button> </n-button>
<n-button class="ml-20" type="primary" @click="handleSearch"> <n-button attr-type="submit" class="ml-20" type="primary">
<i class="i-fe:search mr-4" /> <i class="i-fe:search mr-4" />
搜索 搜索
</n-button> </n-button>
</div> </div>
</form>
</AppCard> </AppCard>
<n-data-table <n-data-table

View File

@ -23,13 +23,7 @@
:get-data="api.read" :get-data="api.read"
> >
<MeQueryItem label="角色名" :label-width="50"> <MeQueryItem label="角色名" :label-width="50">
<n-input <n-input v-model:value="queryItems.name" type="text" placeholder="请输入角色名" clearable />
v-model:value="queryItems.name"
type="text"
placeholder="请输入角色名"
clearable
@keydown.enter="() => $table?.handleSearch()"
/>
</MeQueryItem> </MeQueryItem>
<MeQueryItem label="状态" :label-width="50"> <MeQueryItem label="状态" :label-width="50">
<n-select <n-select

View File

@ -43,7 +43,6 @@
type="text" type="text"
placeholder="请输入用户名" placeholder="请输入用户名"
clearable clearable
@keydown.enter="() => $table?.handleSearch()"
/> />
</MeQueryItem> </MeQueryItem>

View File

@ -28,7 +28,6 @@
type="text" type="text"
placeholder="请输入用户名" placeholder="请输入用户名"
clearable clearable
@keydown.enter="() => $table?.handleSearch()"
/> />
</MeQueryItem> </MeQueryItem>