mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-02 18:28:40 +08:00
fix: typo opend -> opened (#3968)
This commit is contained in:
parent
cec5c11289
commit
1745f480fd
@ -17,11 +17,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PropType, ref, computed, unref, getCurrentInstance, watch, useSlots } from 'vue';
|
||||
import { useDesign } from '@/hooks/web/useDesign';
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
import { useMenuItem } from './useMenu';
|
||||
import { Tooltip } from 'ant-design-vue';
|
||||
import { computed, getCurrentInstance, PropType, ref, unref, useSlots, watch } from 'vue';
|
||||
import { useMenuItem } from './useMenu';
|
||||
import { useSimpleRootMenuContext } from './useSimpleMenuContext';
|
||||
|
||||
defineOptions({ name: 'MenuItem' });
|
||||
@ -76,7 +76,7 @@
|
||||
const { uidList } = getParentList();
|
||||
|
||||
rootMenuEmitter.emit('on-update-opened', {
|
||||
opend: false,
|
||||
opened: false,
|
||||
parent: instance?.parent,
|
||||
uidList: uidList,
|
||||
});
|
||||
|
@ -57,27 +57,27 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { type TimeoutHandle, type Recordable } from '@vben/types';
|
||||
import type { CSSProperties, PropType } from 'vue';
|
||||
import type { SubMenuProvider } from './types';
|
||||
import {
|
||||
computed,
|
||||
unref,
|
||||
getCurrentInstance,
|
||||
reactive,
|
||||
provide,
|
||||
onBeforeMount,
|
||||
inject,
|
||||
} from 'vue';
|
||||
import { useDesign } from '@/hooks/web/useDesign';
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
import { useMenuItem } from './useMenu';
|
||||
import { useSimpleRootMenuContext } from './useSimpleMenuContext';
|
||||
import { CollapseTransition } from '@/components/Transition';
|
||||
import Icon from '@/components/Icon/Icon.vue';
|
||||
import { Popover } from 'ant-design-vue';
|
||||
import { CollapseTransition } from '@/components/Transition';
|
||||
import { useDesign } from '@/hooks/web/useDesign';
|
||||
import { isBoolean, isObject } from '@/utils/is';
|
||||
import { mitt } from '@/utils/mitt';
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
import { type Recordable, type TimeoutHandle } from '@vben/types';
|
||||
import { Popover } from 'ant-design-vue';
|
||||
import type { CSSProperties, PropType } from 'vue';
|
||||
import {
|
||||
computed,
|
||||
getCurrentInstance,
|
||||
inject,
|
||||
onBeforeMount,
|
||||
provide,
|
||||
reactive,
|
||||
unref,
|
||||
} from 'vue';
|
||||
import type { SubMenuProvider } from './types';
|
||||
import { useMenuItem } from './useMenu';
|
||||
import { useSimpleRootMenuContext } from './useSimpleMenuContext';
|
||||
|
||||
defineOptions({ name: 'SubMenu' });
|
||||
|
||||
@ -184,7 +184,7 @@
|
||||
if (unref(getAccordion)) {
|
||||
const { uidList } = getParentList();
|
||||
rootMenuEmitter.emit('on-update-opened', {
|
||||
opend: false,
|
||||
opened: false,
|
||||
parent: instance?.parent,
|
||||
uidList: uidList,
|
||||
});
|
||||
@ -267,9 +267,9 @@
|
||||
return;
|
||||
}
|
||||
if (isObject(data) && rootProps.accordion) {
|
||||
const { opend, parent, uidList } = data as Recordable<any>;
|
||||
const { opened, parent, uidList } = data as Recordable<any>;
|
||||
if (parent === instance?.parent) {
|
||||
state.opened = opend;
|
||||
state.opened = opened;
|
||||
} else if (!uidList.includes(instance?.uid)) {
|
||||
state.opened = false;
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
import type { InjectionKey, Ref, ComponentInternalInstance } from 'vue';
|
||||
import type { Emitter } from '@/utils/mitt';
|
||||
import { createContext, useContext } from '@/hooks/core/useContext';
|
||||
import type { Emitter } from '@/utils/mitt';
|
||||
import type { ComponentInternalInstance, InjectionKey, Ref } from 'vue';
|
||||
|
||||
export type MenuEmitterEvents = {
|
||||
'on-update-opened':
|
||||
| (string | number)[]
|
||||
| {
|
||||
opend: boolean;
|
||||
opened: boolean;
|
||||
parent?: ComponentInternalInstance | null;
|
||||
uidList: number[];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user