feat: use withDefaults for EditLabels
This commit is contained in:
parent
577f5ae69a
commit
6e72606d74
@ -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'})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user