mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
chore(components): improve type for popper effect (#17860)
* chore(components): improve type for popper effect Abort #17758 #17751 #17040 #17030 * chore: use `NonNullable<unknown>` instead of `{}` * chore(components): extract a common type for popper effect --------- Co-authored-by: qiang <qw13131wang@gmail.com>
This commit is contained in:
@@ -140,7 +140,7 @@ export const menuProps = buildProps({
|
||||
* @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed
|
||||
*/
|
||||
popperEffect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'dark',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ export const popperContentProps = buildProps({
|
||||
type: definePropType<ClassType>([String, Array, Object]),
|
||||
},
|
||||
effect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'dark',
|
||||
},
|
||||
visible: Boolean,
|
||||
|
||||
@@ -24,7 +24,9 @@ export const roleTypes = [
|
||||
'tree',
|
||||
] as const
|
||||
|
||||
export type PopperEffect = typeof effects[number]
|
||||
export type PopperEffect =
|
||||
| typeof effects[number]
|
||||
| (string & NonNullable<unknown>)
|
||||
export type PopperTrigger = typeof triggers[number]
|
||||
|
||||
export const popperProps = buildProps({
|
||||
|
||||
@@ -57,7 +57,7 @@ export const SelectProps = buildProps({
|
||||
* @description tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ export const SelectProps = buildProps({
|
||||
* @description tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ export const timeSelectProps = buildProps({
|
||||
* @description Tooltip theme, built-in theme: `dark` / `light`
|
||||
*/
|
||||
effect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'light',
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ export const tooltipV2ContentProps = buildProps({
|
||||
default: 5,
|
||||
},
|
||||
effect: {
|
||||
type: definePropType<PopperEffect | string>(String),
|
||||
type: definePropType<PopperEffect>(String),
|
||||
default: 'light',
|
||||
},
|
||||
contentClass: String,
|
||||
|
||||
Reference in New Issue
Block a user