Browse Source

fix: BsUi-弹窗控件修改

hanxiaohui 5 months ago
parent
commit
e56b3dcf55
2 changed files with 4 additions and 27 deletions
  1. 1 1
      src/components/BsUi/Modal/Modal.vue
  2. 3 26
      src/components/BsUi/Modal/index.js

+ 1 - 1
src/components/BsUi/Modal/Modal.vue

@@ -21,7 +21,7 @@
       default: '标题',
     },
     modalExtraProps: {
-      required: true,
+      required: false,
       default: {},
     },
   });

+ 3 - 26
src/components/BsUi/Modal/index.js

@@ -1,5 +1,5 @@
 import BsModal from './Modal.vue';
-import {onBeforeMount, onMounted, reactive, toRaw} from 'vue';
+import { onBeforeMount, onMounted, reactive, toRaw } from 'vue';
 import { set, get } from 'lodash';
 
 export const useBsModal = (options, modalRef) => {
@@ -13,35 +13,12 @@ export const useBsModal = (options, modalRef) => {
     return toRaw(get(modalOptions, path, undefined));
   };
 
-  const onModalBeforeMount = (callback) => {
-    onBeforeMount(() => {
-      if (typeof callback === 'function') {
-        callback();
-      }
-    });
-  };
-
-  const onModalMounted = (callback) => {
-    onMounted(() => {
-      if (typeof callback === 'function') {
-        callback();
-      }
-    });
-  };
-
-  onMounted(() => {
-    onModalBeforeMount();
-    options.beforeMount && options.beforeMount();
-    options.mounted && options.mounted();
-    onModalMounted();
-  });
+  onMounted(() => {});
 
   return {
-    onModalBeforeMount,
-    onModalMounted,
     modalOptions,
     setModalPropsValue,
-    getModalPropsValue
+    getModalPropsValue,
   };
 };