1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

feat: makes button for page size smaller (#2707)

This commit is contained in:
Amir Raminfar
2024-01-17 14:01:18 -08:00
committed by GitHub
parent 6f96303f1d
commit 9d2a8af435
3 changed files with 8 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
<div class="text-right"> <div class="text-right">
Show per page Show per page
<dropdown-menu <dropdown-menu
class="dropdown-left" class="dropdown-left btn-xs md:btn-sm"
v-model="perPage" v-model="perPage"
:options="pageSizes.map((i) => ({ label: i.toLocaleString(), value: i }))" :options="pageSizes.map((i) => ({ label: i.toLocaleString(), value: i }))"
v-if="containers.length > 0" v-if="containers.length > 0"

View File

@@ -5,7 +5,7 @@
</label> </label>
<div <div
tabindex="0" tabindex="0"
class="min-w-52 dropdown-content rounded-box z-50 mt-1 border border-base-content/20 bg-base p-2 shadow" class="dropdown-content z-50 mt-1 min-w-52 rounded-box border border-base-content/20 bg-base p-2 shadow"
> >
<slot name="content"></slot> <slot name="content"></slot>
</div> </div>

View File

@@ -23,11 +23,16 @@ type DropdownItem = {
label: string; label: string;
value: T; value: T;
}; };
const { options = [], defaultLabel = "" } = defineProps<{ options?: DropdownItem[]; defaultLabel?: string }>();
const { modelValue } = defineModels<{ const { modelValue } = defineModels<{
modelValue: T; modelValue: T;
}>(); }>();
const { options = [], defaultLabel = "" } = defineProps<{
options?: DropdownItem[];
defaultLabel?: string;
}>();
const label = computed(() => options.find((item) => item.value === modelValue.value)?.label ?? defaultLabel); const label = computed(() => options.find((item) => item.value === modelValue.value)?.label ?? defaultLabel);
const details = ref<HTMLElement | null>(null); const details = ref<HTMLElement | null>(null);
const close = () => details.value?.removeAttribute("open"); const close = () => details.value?.removeAttribute("open");