mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
fix checkbox warnings for real now
This commit is contained in:
parent
f4ce3faca7
commit
88b838ef3e
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { defineProps, PropType } from "vue";
|
||||
import { PropType } from "vue";
|
||||
import { hasSlotContent } from "~/composables/useSlot";
|
||||
import Table from "~/components/design/Table.vue";
|
||||
|
||||
|
@ -2,14 +2,14 @@
|
||||
import { computed } from "vue";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "update:modelValue", value: boolean): void;
|
||||
(e: "update:modelValue", value: boolean | boolean[]): void;
|
||||
}>();
|
||||
const value = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (v) => emit("update:modelValue", v),
|
||||
});
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
modelValue: boolean | boolean[];
|
||||
label?: string;
|
||||
}>();
|
||||
</script>
|
||||
|
@ -37,10 +37,10 @@ const versions = [
|
||||
];
|
||||
|
||||
const filters = ref({
|
||||
versions: {},
|
||||
categories: {},
|
||||
platforms: {},
|
||||
licences: {},
|
||||
versions: [],
|
||||
categories: [],
|
||||
platforms: [],
|
||||
licences: [],
|
||||
});
|
||||
|
||||
const ctx = useContext();
|
||||
@ -95,7 +95,7 @@ const projects = await useProjects().catch((e) => handleRequestError(e, ctx, i18
|
||||
<div class="versions">
|
||||
<h3 class="font-bold">Minecraft versions</h3>
|
||||
<div class="flex flex-col gap-2 max-h-30 overflow-auto">
|
||||
<InputCheckbox v-for="version in versions" :key="version.version" v-model="filters.versions[version.version]" :label="version.version" />
|
||||
<InputCheckbox v-for="version in versions" :key="version.version" v-model="filters.versions" :value="version.version" :label="version.version" />
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
@ -105,7 +105,8 @@ const projects = await useProjects().catch((e) => handleRequestError(e, ctx, i18
|
||||
<InputCheckbox
|
||||
v-for="category in backendData.visibleCategories"
|
||||
:key="category.apiName"
|
||||
v-model="filters.categories[category.apiName]"
|
||||
v-model="filters.categories"
|
||||
:value="category.apiName"
|
||||
:label="i18n.t(category.title)"
|
||||
/>
|
||||
</div>
|
||||
@ -117,7 +118,8 @@ const projects = await useProjects().catch((e) => handleRequestError(e, ctx, i18
|
||||
<InputCheckbox
|
||||
v-for="platform in backendData.visiblePlatforms"
|
||||
:key="platform.enumName"
|
||||
v-model="filters.platforms[platform.enumName]"
|
||||
v-model="filters.platforms"
|
||||
:value="platform.enumName"
|
||||
:label="platform.name"
|
||||
/>
|
||||
</div>
|
||||
@ -126,7 +128,7 @@ const projects = await useProjects().catch((e) => handleRequestError(e, ctx, i18
|
||||
<div class="licenses">
|
||||
<h3 class="font-bold">Licenses</h3>
|
||||
<div class="flex flex-col gap-2">
|
||||
<InputCheckbox v-for="license in backendData.licenses" :key="license" v-model="filters.licences[license]" :label="license" />
|
||||
<InputCheckbox v-for="license in backendData.licenses" :key="license" v-model="filters.licences" :value="license" :label="license" />
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
Loading…
Reference in New Issue
Block a user