Browse Source

修改弹框model

zhaoke 2 years ago
parent
commit
06da73f584
1 changed files with 14 additions and 14 deletions
  1. 14 14
      src/components/dialog/index.vue

+ 14 - 14
src/components/dialog/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="dialog">
-    <el-dialog v-model="props.flag" :append-to-body="props.isBody" ref="dialogTk" :top="props.top" :custom-class="props.customClass" :lock-scroll="false" :modal="props.modal" :before-close="props.close" :close-on-click-modal="false" :width="props.width" :show-close="props.showFlag">
+    <el-dialog :model-value="props.flag" :append-to-body="props.isBody" ref="dialogTk" :top="props.top" :custom-class="props.customClass" :lock-scroll="false" :modal="props.modal" :before-close="props.close" :close-on-click-modal="false" :width="props.width" :show-close="props.showFlag">
       <div class="dialog-content">
         <slot />
       </div>
@@ -13,44 +13,44 @@ const props = defineProps({
   // 弹框开关
   flag: {
     type: Boolean,
-    default: false
+    default: false,
   },
   showFlag: {
     type: Boolean,
-    default: false
+    default: false,
   },
   // 弹框宽度
   width: {
     type: String,
-    default: '400px'
+    default: "400px",
   },
   // 弹框类名
   customClass: {
     type: String,
-    default: ''
+    default: "",
   },
   // 弹框高度
   top: {
     type: String,
-    default: '0vh'
+    default: "0vh",
   },
   // 弹框遮罩层
   modal: {
     type: Boolean,
-    default: true
+    default: true,
   },
   // 二级弹框标记
   child: {
     type: Boolean,
-    default: false
+    default: false,
   },
   isBody: {
     type: Boolean,
-    default: true
-  }
-})
-const emits = defineEmits(['closeDialog'])
+    default: true,
+  },
+});
+const emits = defineEmits(["closeDialog"]);
 const close = () => {
-  emits('closeDialog')
-}
+  emits("closeDialog");
+};
 </script>