mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-04-30 22:29:01 +08:00
Merge branch '2.x' of https://github.com/zclzone/vue-naive-admin into 2.x
This commit is contained in:
commit
7dde0bbfc6
@ -9,10 +9,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4">
|
<AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4">
|
||||||
<form class="flex justify-between p-16" @submit.prevent="handleSearch()">
|
<form class="flex justify-between p-16" @submit.prevent="handleSearch()">
|
||||||
<n-space wrap :size="[32, 16]">
|
<n-scrollbar x-scrollable>
|
||||||
<slot />
|
<n-space :wrap="!expand || isExpanded" :size="[32, 16]" class="p-10">
|
||||||
</n-space>
|
<slot />
|
||||||
<div class="flex-shrink-0">
|
</n-space>
|
||||||
|
</n-scrollbar>
|
||||||
|
<div class="flex-shrink-0 p-10">
|
||||||
<n-button ghost type="primary" @click="handleReset">
|
<n-button ghost type="primary" @click="handleReset">
|
||||||
<i class="i-fe:rotate-ccw mr-4" />
|
<i class="i-fe:rotate-ccw mr-4" />
|
||||||
重置
|
重置
|
||||||
@ -21,6 +23,17 @@
|
|||||||
<i class="i-fe:search mr-4" />
|
<i class="i-fe:search mr-4" />
|
||||||
搜索
|
搜索
|
||||||
</n-button>
|
</n-button>
|
||||||
|
|
||||||
|
<template v-if="expand">
|
||||||
|
<n-button v-if="!isExpanded" type="primary" text @click="toggleExpand">
|
||||||
|
<i class="i-fe:chevrons-down ml-4" />
|
||||||
|
展开
|
||||||
|
</n-button>
|
||||||
|
<n-button v-else text type="primary" @click="toggleExpand">
|
||||||
|
<i class="i-fe:chevrons-up ml-4" />
|
||||||
|
收起
|
||||||
|
</n-button>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</AppCard>
|
</AppCard>
|
||||||
@ -89,6 +102,8 @@ const props = defineProps({
|
|||||||
type: Function,
|
type: Function,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
/** 是否支持展开 */
|
||||||
|
expand: Boolean,
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:queryItems', 'onChecked', 'onDataChange'])
|
const emit = defineEmits(['update:queryItems', 'onChecked', 'onDataChange'])
|
||||||
@ -103,6 +118,13 @@ const pagination = reactive({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 是否展开
|
||||||
|
const isExpanded = ref(false)
|
||||||
|
|
||||||
|
function toggleExpand() {
|
||||||
|
isExpanded.value = !isExpanded.value
|
||||||
|
}
|
||||||
|
|
||||||
async function handleQuery() {
|
async function handleQuery() {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user