2023-10-04 19:38:50 -04:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { useField } from "vee-validate";
|
|
|
|
const fname = inject<string>("curName");
|
2023-10-05 02:04:17 -04:00
|
|
|
let { data: data } = await useApiFetch("/genres");
|
|
|
|
let opts = (data.value as unknown as any[]).map((a) => ({
|
2023-10-04 19:38:50 -04:00
|
|
|
value: a,
|
|
|
|
label: a,
|
|
|
|
}));
|
2023-12-29 20:53:29 -05:00
|
|
|
const { value, errorMessage, name, setValue } = useField<string[]>(fname + "genre");
|
2023-10-04 19:38:50 -04:00
|
|
|
</script>
|
|
|
|
<template>
|
2023-12-29 20:53:29 -05:00
|
|
|
<a-form-item :help="errorMessage" label="Genre(s)" :validate-status="!!errorMessage ? 'error' : undefined">
|
2024-03-16 21:18:07 -04:00
|
|
|
<a-select v-bind="$attrs" :allow-clear="true" :options="opts" v-model:value="value" mode="multiple">
|
2023-10-04 19:38:50 -04:00
|
|
|
<template #removeIcon>
|
|
|
|
<i class="far fa-circle-x" />
|
|
|
|
</template>
|
|
|
|
</a-select>
|
|
|
|
</a-form-item>
|
|
|
|
</template>
|