feat(components): [el-menu] support customize popper offset (#6049)

* feat(components): [el-menu] support customize popper offset

* docs: improve docs
This commit is contained in:
msidolphin 2022-02-15 11:06:21 +08:00 committed by GitHub
parent aa639e81f1
commit 4b6e9889de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -85,6 +85,7 @@ menu/collapse
| hide-timeout | timeout before hiding a sub-menu | number | — | 300 |
| disabled | whether the sub-menu is disabled | boolean | — | false |
| popper-append-to-body(deprecated) | whether to append the popup menu to body. If the positioning of the menu is wrong, you can try setting this prop | boolean | - | level one SubMenu: true / other SubMenus: false |
| popper-offset | offset of the popper | number | — | 6 |
## SubMenu Slots

View File

@ -46,6 +46,10 @@ export const subMenuProps = buildProps({
type: Boolean,
default: undefined,
},
popperOffset: {
type: Number,
default: 6,
},
} as const)
export type SubMenuProps = ExtractPropTypes<typeof subMenuProps>
@ -312,7 +316,7 @@ export default defineComponent({
visible: opened.value,
effect: 'light',
pure: true,
offset: 6,
offset: props.popperOffset,
showArrow: false,
persistent: true,
popperClass: props.popperClass,