1
0

feat: use withDefaults for EditLabels

This commit is contained in:
Dominik Pschenitschni 2024-07-06 12:59:03 +02:00 committed by konrad
parent 577f5ae69a
commit 6e72606d74

View File

@ -46,7 +46,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {type PropType, ref, computed, shallowReactive, watch} from 'vue' import {ref, computed, shallowReactive, watch} from 'vue'
import {useI18n} from 'vue-i18n' import {useI18n} from 'vue-i18n'
import LabelModel from '@/models/label' import LabelModel from '@/models/label'
@ -60,27 +60,21 @@ import {useLabelStore} from '@/stores/labels'
import {useTaskStore} from '@/stores/tasks' import {useTaskStore} from '@/stores/tasks'
import {getRandomColorHex} from '@/helpers/color/randomColor' import {getRandomColorHex} from '@/helpers/color/randomColor'
const props = defineProps({ const props = withDefaults(defineProps<{
modelValue: { modelValue: ILabel[] | undefined
type: Array as PropType<ILabel[]>, taskId?: number
default: () => [], disabled?: boolean
}, creatable?: boolean
taskId: { }>(), {
type: Number, modelValue: () => [],
required: false, taskId: 0,
default: 0, disabled: false,
}, creatable: true,
disabled: {
type: Boolean,
default: false,
},
creatable: {
type: Boolean,
default: true,
},
}) })
const emit = defineEmits(['update:modelValue']) const emit = defineEmits<{
'update:modelValue': [labels: ILabel[]],
}>()
const {t} = useI18n({useScope: 'global'}) const {t} = useI18n({useScope: 'global'})