fix: fix modal and drawer component missing uid

This commit is contained in:
vben
2020-12-13 00:22:30 +08:00
parent f7ec3c931e
commit 1293a7389e
7 changed files with 14 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
import { withInstall } from '../util';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
import AppLogo from './src/AppLogo.vue';
export const AppLocalePicker = createAsyncComponent(() => import('./src/AppLocalePicker.vue'), {
loading: true,
@@ -8,8 +9,9 @@ export const AppProvider = createAsyncComponent(() => import('./src/AppProvider.
export const AppSearch = createAsyncComponent(() => import('./src/search/AppSearch.vue'), {
loading: true,
});
export const AppLogo = createAsyncComponent(() => import('./src/AppLogo.vue'));
// export const AppLogo = createAsyncComponent(() => import('./src/AppLogo.vue'));
withInstall(AppLocalePicker, AppLogo, AppProvider, AppSearch);
export { useAppProviderContext } from './src/useAppContext';
export { AppLogo };

View File

@@ -102,7 +102,7 @@ export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => {
uidRef.value = uuid;
drawerInstanceRef.value = modalInstance;
currentInstall.emit('register', modalInstance);
currentInstall.emit('register', modalInstance, uuid);
};
watchEffect(() => {

View File

@@ -90,6 +90,9 @@ export const useModalInner = (callbackFn?: Fn): UseModalInnerReturnType => {
throw new Error('instance is undefined!');
}
// currentInstall.type.emits = [...currentInstall.type.emits, 'register'];
// Object.assign(currentInstall.type.emits, ['register']);
const getInstance = () => {
const instance = unref(modalInstanceRef);
if (!instance) {
@@ -103,10 +106,9 @@ export const useModalInner = (callbackFn?: Fn): UseModalInnerReturnType => {
tryOnUnmounted(() => {
modalInstanceRef.value = null;
});
uidRef.value = uuid;
modalInstanceRef.value = modalInstance;
currentInstall.emit('register', modalInstance);
currentInstall.emit('register', modalInstance, uuid);
};
watchEffect(() => {