refactor: replace defineModels with defineModel
This commit is contained in:
parent
e6172ad38b
commit
d23f1d39eb
17 changed files with 35 additions and 56 deletions
|
@ -2,9 +2,7 @@
|
|||
const emit = defineEmits<{
|
||||
(event: 'close'): void
|
||||
}>()
|
||||
const { modelValue: visible } = defineModels<{
|
||||
modelValue?: boolean
|
||||
}>()
|
||||
const visible = defineModel<boolean>()
|
||||
|
||||
function close() {
|
||||
emit('close')
|
||||
|
|
|
@ -5,9 +5,7 @@ defineProps<{
|
|||
iconChecked?: string
|
||||
iconUnchecked?: string
|
||||
}>()
|
||||
const { modelValue } = defineModels<{
|
||||
modelValue?: boolean | null
|
||||
}>()
|
||||
const modelValue = defineModel<boolean | null>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -14,10 +14,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
stencilSizePercentage: 0.9,
|
||||
})
|
||||
|
||||
const { modelValue: file } = defineModels<{
|
||||
/** Images to be cropped */
|
||||
modelValue: File | null
|
||||
}>()
|
||||
const file = defineModel<File | null>()
|
||||
|
||||
const cropperDialog = ref(false)
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@ const emit = defineEmits<{
|
|||
(event: 'error', code: number, message: string): void
|
||||
}>()
|
||||
|
||||
const { modelValue: file } = defineModels<{
|
||||
modelValue: FileWithHandle | null
|
||||
}>()
|
||||
const file = defineModel<FileWithHandle | null>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ defineProps<{
|
|||
value: any
|
||||
hover?: boolean
|
||||
}>()
|
||||
const { modelValue } = defineModels<{
|
||||
modelValue: any
|
||||
}>()
|
||||
const modelValue = defineModel()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -8,9 +8,7 @@ const { options, command } = defineProps<{
|
|||
command?: boolean
|
||||
}>()
|
||||
|
||||
const { modelValue } = defineModels<{
|
||||
modelValue: string
|
||||
}>()
|
||||
const modelValue = defineModel<string>({ required: true })
|
||||
|
||||
const tabs = $computed(() => {
|
||||
return options.map((option) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue