fix: <OperateDrawer> 使用defineModel定义visible

This commit is contained in:
dhb52 2024-05-04 23:57:38 +08:00
parent e7418c2627
commit a7752db587

View File

@ -17,11 +17,14 @@ interface Emits {
(e: 'update:modelValue', modelValue: boolean): void; (e: 'update:modelValue', modelValue: boolean): void;
} }
const visible = defineModel<boolean>('visible', {
default: false
});
const emit = defineEmits<Emits>(); const emit = defineEmits<Emits>();
const slots = defineSlots(); const slots = defineSlots();
const appStore = useAppStore(); const appStore = useAppStore();
const state = reactive({ width: 0 }); const state = reactive({ width: 0 });
const visible = ref(props.modelValue);
const isFullscreen = ref(false); const isFullscreen = ref(false);
const drawerWidth = computed(() => { const drawerWidth = computed(() => {
const maxMinWidth = 360; const maxMinWidth = 360;