mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
fix: menu cannot be collapsed by the Layout (#2819)
This commit is contained in:
parent
c78e9418a4
commit
c1cfabb20e
@ -1,4 +1,4 @@
|
||||
import { inject, provide } from 'vue';
|
||||
import { inject, provide, toRef } from 'vue';
|
||||
import omit from 'omit.js';
|
||||
import VcMenu, { Divider, ItemGroup } from '../vc-menu';
|
||||
import SubMenu from './SubMenu';
|
||||
@ -61,9 +61,12 @@ const Menu = {
|
||||
provide('menuPropsContext', this.$props);
|
||||
},
|
||||
setup() {
|
||||
const layoutSiderContext = inject('layoutSiderContext', {});
|
||||
const layoutSiderCollapsed = toRef(layoutSiderContext, 'sCollapsed');
|
||||
return {
|
||||
configProvider: inject('configProvider', ConfigConsumerProps),
|
||||
layoutSiderContext: inject('layoutSiderContext', {}),
|
||||
layoutSiderContext,
|
||||
layoutSiderCollapsed,
|
||||
};
|
||||
},
|
||||
// model: {
|
||||
@ -88,7 +91,7 @@ const Menu = {
|
||||
inlineCollapsed(val) {
|
||||
this.collapsedChange(val);
|
||||
},
|
||||
'layoutSiderContext.sCollapsed'(val) {
|
||||
layoutSiderCollapsed(val) {
|
||||
this.collapsedChange(val);
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user