mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [abort popper] fix effect type error (#17758)
closed #17751
This commit is contained in:
@@ -65,27 +65,27 @@ menu/popper-offset
|
||||
|
||||
### Menu Attributes
|
||||
|
||||
| Name | Description | Type | Default |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- |
|
||||
| mode | menu display mode | ^[enum]`'horizontal' \| 'vertical'` | vertical |
|
||||
| collapse | whether the menu is collapsed (available only in vertical mode) | ^[boolean] | false |
|
||||
| ellipsis | whether the menu is ellipsis (available only in horizontal mode) | ^[boolean] | true |
|
||||
| ellipsis-icon ^(2.4.4) | custom ellipsis icon (available only in horizontal mode and ellipsis is true) | ^[string] / ^[Component] | — |
|
||||
| popper-offset ^(2.4.4) | offset of the popper (effective for all submenus) | ^[number] | 6 |
|
||||
| background-color ^(deprecated) | background color of Menu (hex format) (deprecated, use `--el-menu-bg-color` in a style class instead) | ^[string] | #ffffff |
|
||||
| text-color ^(deprecated) | text color of Menu (hex format) (deprecated, use `--el-menu-text-color` in a style class instead) | ^[string] | #303133 |
|
||||
| active-text-color ^(deprecated) | text color of currently active menu item (hex format) (deprecated, use `--el-menu-active-color` in a style class instead) | ^[string] | #409eff |
|
||||
| default-active | index of active menu on page load | ^[string] | '' |
|
||||
| default-openeds | array that contains indexes of currently active sub-menus | ^[object]`string[]` | [] |
|
||||
| unique-opened | whether only one sub-menu can be active | ^[boolean] | false |
|
||||
| menu-trigger | how sub-menus are triggered, only works when `mode` is 'horizontal' | ^[enum]`'hover' \| 'click'` | hover |
|
||||
| router | whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load. | ^[boolean] | false |
|
||||
| collapse-transition | whether to enable the collapse transition | ^[boolean] | true |
|
||||
| popper-effect ^(2.2.26) | Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed | ^[enum]`'dark' \| 'light'` | dark |
|
||||
| close-on-click-outside ^(2.4.4) | optional, whether menu is collapsed when clicking outside | ^[boolean] | false |
|
||||
| popper-class ^(2.5.0) | custom class name for all popup menus | ^[string] | — |
|
||||
| show-timeout ^(2.5.0) | control timeout for all menus before showing | ^[number] | 300 |
|
||||
| hide-timeout ^(2.5.0) | control timeout for all menus before hiding | ^[number] | 300 |
|
||||
| Name | Description | Type | Default |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------- |
|
||||
| mode | menu display mode | ^[enum]`'horizontal' \| 'vertical'` | vertical |
|
||||
| collapse | whether the menu is collapsed (available only in vertical mode) | ^[boolean] | false |
|
||||
| ellipsis | whether the menu is ellipsis (available only in horizontal mode) | ^[boolean] | true |
|
||||
| ellipsis-icon ^(2.4.4) | custom ellipsis icon (available only in horizontal mode and ellipsis is true) | ^[string] / ^[Component] | — |
|
||||
| popper-offset ^(2.4.4) | offset of the popper (effective for all submenus) | ^[number] | 6 |
|
||||
| background-color ^(deprecated) | background color of Menu (hex format) (deprecated, use `--el-menu-bg-color` in a style class instead) | ^[string] | #ffffff |
|
||||
| text-color ^(deprecated) | text color of Menu (hex format) (deprecated, use `--el-menu-text-color` in a style class instead) | ^[string] | #303133 |
|
||||
| active-text-color ^(deprecated) | text color of currently active menu item (hex format) (deprecated, use `--el-menu-active-color` in a style class instead) | ^[string] | #409eff |
|
||||
| default-active | index of active menu on page load | ^[string] | '' |
|
||||
| default-openeds | array that contains indexes of currently active sub-menus | ^[object]`string[]` | [] |
|
||||
| unique-opened | whether only one sub-menu can be active | ^[boolean] | false |
|
||||
| menu-trigger | how sub-menus are triggered, only works when `mode` is 'horizontal' | ^[enum]`'hover' \| 'click'` | hover |
|
||||
| router | whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load. | ^[boolean] | false |
|
||||
| collapse-transition | whether to enable the collapse transition | ^[boolean] | true |
|
||||
| popper-effect ^(2.2.26) | Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed | ^[enum]`'dark' \| 'light'` / ^[string] | dark |
|
||||
| close-on-click-outside ^(2.4.4) | optional, whether menu is collapsed when clicking outside | ^[boolean] | false |
|
||||
| popper-class ^(2.5.0) | custom class name for all popup menus | ^[string] | — |
|
||||
| show-timeout ^(2.5.0) | control timeout for all menus before showing | ^[number] | 300 |
|
||||
| hide-timeout ^(2.5.0) | control timeout for all menus before hiding | ^[number] | 300 |
|
||||
|
||||
### Menu Events
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ popover/directive-usage
|
||||
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| trigger | how the popover is triggered | ^[enum]`'click' \| 'focus' \| 'hover' \| 'contextmenu'` | hover |
|
||||
| title | popover title | ^[string] | — |
|
||||
| effect | Tooltip theme, built-in theme: `dark` / `light` | ^[enum]`'dark' \| 'light'` | light |
|
||||
| effect | Tooltip theme, built-in theme: `dark` / `light` | ^[enum]`'dark' \| 'light'` / ^[string] | light |
|
||||
| content | popover content, can be replaced with a default `slot` | ^[string] | '' |
|
||||
| width | popover width | ^[string] / ^[number] | 150 |
|
||||
| placement | popover placement | ^[enum]`'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | bottom |
|
||||
|
||||
@@ -32,6 +32,7 @@ import Menubar from './utils/menu-bar'
|
||||
import ElMenuCollapseTransition from './menu-collapse-transition.vue'
|
||||
import ElSubMenu from './sub-menu'
|
||||
import { useMenuCssVar } from './use-menu-css-var'
|
||||
import type { PopperEffect } from '@element-plus/components/popper'
|
||||
|
||||
import type { MenuItemClicked, MenuProvider, SubMenuProvider } from './types'
|
||||
import type { NavigationFailure, Router } from 'vue-router'
|
||||
@@ -138,8 +139,7 @@ export const menuProps = buildProps({
|
||||
* @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed
|
||||
*/
|
||||
popperEffect: {
|
||||
type: String,
|
||||
values: ['dark', 'light'],
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'dark',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ export const popperContentProps = buildProps({
|
||||
type: definePropType<ClassType>([String, Array, Object]),
|
||||
},
|
||||
effect: {
|
||||
type: definePropType<PopperEffect>(String),
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'dark',
|
||||
},
|
||||
visible: Boolean,
|
||||
|
||||
@@ -49,7 +49,7 @@ export const SelectProps = buildProps({
|
||||
* @description tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect>(String),
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ export const SelectProps = buildProps({
|
||||
* @description tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect>(String),
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ export const timeSelectProps = buildProps({
|
||||
* @description Tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect>(String),
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ export const tooltipV2ContentProps = buildProps({
|
||||
default: 5,
|
||||
},
|
||||
effect: {
|
||||
type: definePropType<PopperEffect>(String),
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
default: 'light',
|
||||
},
|
||||
contentClass: String,
|
||||
|
||||
Reference in New Issue
Block a user