fix: menu horizontal mode shaking

This commit is contained in:
tangjinzhou 2022-03-02 13:48:02 +08:00
parent fe0fc8084f
commit 55e0ad7f92

View File

@ -42,7 +42,6 @@ export default defineComponent({
forceSubMenuRender,
motion,
defaultMotions,
mode,
} = useInjectMenu();
const forceRender = useInjectForceRender();
const placement = computed(() =>
@ -74,7 +73,7 @@ export default defineComponent({
const style = ref({});
const className = ref('');
const mergedMotion = computed(() => {
const m = motion.value || defaultMotions.value?.[mode.value] || defaultMotions.value?.other;
const m = motion.value || defaultMotions.value?.[props.mode] || defaultMotions.value?.other;
const res = typeof m === 'function' ? m(style, className) : m;
return res ? getTransitionProps(res.name, { css: true }) : undefined;
});