@@ -45,6 +45,7 @@ const Menu = {
4545 mixins : [ BaseMixin ] ,
4646 inject : {
4747 layoutSiderContext : { default : { } } ,
48+ configProvider : { default : { } } ,
4849 } ,
4950 model : {
5051 prop : 'selectedKeys' ,
@@ -176,26 +177,19 @@ const Menu = {
176177 const { openAnimation, openTransitionName } = this . $props
177178 let menuOpenAnimation = openAnimation || openTransitionName
178179 if ( openAnimation === undefined && openTransitionName === undefined ) {
179- switch ( menuMode ) {
180- case 'horizontal' :
181- menuOpenAnimation = 'slide-up'
182- break
183- case 'vertical' :
184- case 'vertical-left' :
185- case 'vertical-right' :
180+ if ( menuMode === 'horizontal' ) {
181+ menuOpenAnimation = 'slide-up'
182+ } else if ( menuMode === 'inline' ) {
183+ menuOpenAnimation = { on : animation }
184+ } else {
186185 // When mode switch from inline
187186 // submenu should hide without animation
188- if ( this . switchingModeFromInline ) {
189- menuOpenAnimation = ''
190- this . switchingModeFromInline = false
191- } else {
192- menuOpenAnimation = 'zoom-big'
193- }
194- break
195- case 'inline' :
196- menuOpenAnimation = { on : animation }
197- break
198- default :
187+ if ( this . switchingModeFromInline ) {
188+ menuOpenAnimation = ''
189+ this . switchingModeFromInline = false
190+ } else {
191+ menuOpenAnimation = 'zoom-big'
192+ }
199193 }
200194 }
201195 return menuOpenAnimation
@@ -204,7 +198,8 @@ const Menu = {
204198 render ( ) {
205199 const { layoutSiderContext, $slots, $listeners } = this
206200 const { collapsedWidth } = layoutSiderContext
207- const { prefixCls, theme } = this . $props
201+ const { getPopupContainer : getContextPopupContainer } = this . configProvider
202+ const { prefixCls, theme, getPopupContainer } = this . $props
208203 const menuMode = this . getRealMenuMode ( )
209204 const menuOpenAnimation = this . getMenuOpenAnimation ( menuMode )
210205
@@ -216,6 +211,7 @@ const Menu = {
216211 const menuProps = {
217212 props : {
218213 ...omit ( this . $props , [ 'inlineCollapsed' ] ) ,
214+ getPopupContainer : getPopupContainer || getContextPopupContainer ,
219215 openKeys : this . sOpenKeys ,
220216 mode : menuMode ,
221217 } ,
0 commit comments