feat(components): [menu] add popper-effect menu attribute (#10867)

This commit is contained in:
RealityBoy 2022-12-02 13:23:59 +08:00 committed by GitHub
parent e0150db5b6
commit 0fb2dc950c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,7 @@
rootMenu.props.collapse &&
$slots.title
"
:effect="Effect.DARK"
:effect="rootMenu.props.popperEffect"
placement="right"
:fallback-placements="['left']"
persistent
@ -47,7 +47,6 @@ import {
toRef,
} from 'vue'
import ElTooltip from '@element-plus/components/tooltip'
import { Effect } from '@element-plus/components/popper'
import { throwError } from '@element-plus/utils'
import { useNamespace } from '@element-plus/hooks'
import useMenu from './use-menu'
@ -106,7 +105,6 @@ export default defineComponent({
})
return {
Effect,
parentMenu,
rootMenu,
active,

View File

@ -66,6 +66,11 @@ export const menuProps = buildProps({
type: Boolean,
default: true,
},
popperEffect: {
type: String,
values: ['dark', 'light'],
default: 'dark',
},
} as const)
export type MenuProps = ExtractPropTypes<typeof menuProps>