fix: typo opend -> opened (#3968)
This commit is contained in:
parent
cec5c11289
commit
1745f480fd
|
|
@ -17,11 +17,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType, ref, computed, unref, getCurrentInstance, watch, useSlots } from 'vue';
|
|
||||||
import { useDesign } from '@/hooks/web/useDesign';
|
import { useDesign } from '@/hooks/web/useDesign';
|
||||||
import { propTypes } from '@/utils/propTypes';
|
import { propTypes } from '@/utils/propTypes';
|
||||||
import { useMenuItem } from './useMenu';
|
|
||||||
import { Tooltip } from 'ant-design-vue';
|
import { Tooltip } from 'ant-design-vue';
|
||||||
|
import { computed, getCurrentInstance, PropType, ref, unref, useSlots, watch } from 'vue';
|
||||||
|
import { useMenuItem } from './useMenu';
|
||||||
import { useSimpleRootMenuContext } from './useSimpleMenuContext';
|
import { useSimpleRootMenuContext } from './useSimpleMenuContext';
|
||||||
|
|
||||||
defineOptions({ name: 'MenuItem' });
|
defineOptions({ name: 'MenuItem' });
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
const { uidList } = getParentList();
|
const { uidList } = getParentList();
|
||||||
|
|
||||||
rootMenuEmitter.emit('on-update-opened', {
|
rootMenuEmitter.emit('on-update-opened', {
|
||||||
opend: false,
|
opened: false,
|
||||||
parent: instance?.parent,
|
parent: instance?.parent,
|
||||||
uidList: uidList,
|
uidList: uidList,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -57,27 +57,27 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 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 { isBoolean, isObject } from '@/utils/is';
|
||||||
import { mitt } from '@/utils/mitt';
|
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' });
|
defineOptions({ name: 'SubMenu' });
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@
|
||||||
if (unref(getAccordion)) {
|
if (unref(getAccordion)) {
|
||||||
const { uidList } = getParentList();
|
const { uidList } = getParentList();
|
||||||
rootMenuEmitter.emit('on-update-opened', {
|
rootMenuEmitter.emit('on-update-opened', {
|
||||||
opend: false,
|
opened: false,
|
||||||
parent: instance?.parent,
|
parent: instance?.parent,
|
||||||
uidList: uidList,
|
uidList: uidList,
|
||||||
});
|
});
|
||||||
|
|
@ -267,9 +267,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isObject(data) && rootProps.accordion) {
|
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) {
|
if (parent === instance?.parent) {
|
||||||
state.opened = opend;
|
state.opened = opened;
|
||||||
} else if (!uidList.includes(instance?.uid)) {
|
} else if (!uidList.includes(instance?.uid)) {
|
||||||
state.opened = false;
|
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 { createContext, useContext } from '@/hooks/core/useContext';
|
||||||
|
import type { Emitter } from '@/utils/mitt';
|
||||||
|
import type { ComponentInternalInstance, InjectionKey, Ref } from 'vue';
|
||||||
|
|
||||||
export type MenuEmitterEvents = {
|
export type MenuEmitterEvents = {
|
||||||
'on-update-opened':
|
'on-update-opened':
|
||||||
| (string | number)[]
|
| (string | number)[]
|
||||||
| {
|
| {
|
||||||
opend: boolean;
|
opened: boolean;
|
||||||
parent?: ComponentInternalInstance | null;
|
parent?: ComponentInternalInstance | null;
|
||||||
uidList: number[];
|
uidList: number[];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue