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

View File

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