refactor: use defineModel

This commit is contained in:
三咲智子 2023-01-06 23:46:36 +08:00
parent 85ac005570
commit cffcddefb9
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
9 changed files with 177 additions and 138 deletions

View file

@ -2,9 +2,6 @@
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
export interface Props {
/** v-model dislog visibility */
modelValue: boolean
/**
* level of depth
*
@ -48,11 +45,13 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<{
/** v-model dialog visibility */
(event: 'update:modelValue', value: boolean): void
(event: 'close',): void
}>()
const visible = useVModel(props, 'modelValue', emit, { passive: true })
const { modelValue: visible } = defineModel<{
/** v-model dislog visibility */
modelValue: boolean
}>()
const deactivated = useDeactivated()
const route = useRoute()