Skip to content

Commit

Permalink
fix FormSelect type error
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Nov 13, 2023
1 parent 4c0c740 commit 0b212d3
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions client/src/components/Form/Elements/FormSelect.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, type ComputedRef, onMounted, watch } from "vue";
import { computed, type ComputedRef, onMounted, type PropType, watch } from "vue";
import Multiselect from "vue-multiselect";
import { useMultiselect } from "@/composables/useMultiselect";
Expand All @@ -14,25 +14,33 @@ interface SelectOption {
value: SelectValue;
}
const props = withDefaults(
defineProps<{
id?: string;
disabled?: boolean;
multiple?: boolean;
optional?: boolean;
options: Array<SelectOption>;
placeholder?: string;
value?: Array<SelectValue> | Record<string, unknown> | string | number;
}>(),
{
id: `form-select-${uid()}`,
disabled: false,
multiple: false,
optional: false,
placeholder: "Select value",
value: null,
}
);
const props = defineProps({
id: { type: String, default: `form-select-${uid()}` },
disabled: {
type: Boolean,
default: false,
},
multiple: {
type: Boolean,
default: false,
},
optional: {
type: Boolean,
default: false,
},
options: {
type: Array as PropType<Array<SelectOption>>,
required: true,
},
placeholder: {
type: String,
default: "Select Value",
},
value: {
type: String as PropType<SelectValue | SelectValue[]>,
default: null,
},
});
const emit = defineEmits<{
(e: "input", value: SelectValue | Array<SelectValue>): void;
Expand Down

0 comments on commit 0b212d3

Please sign in to comment.