mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
refactor(components): [image-viewer] simplify emits type checking (#8329)
This commit is contained in:
parent
ca4d4ffcac
commit
cf9339567b
@ -1,4 +1,9 @@
|
||||
import { buildProps, definePropType, mutable } from '@element-plus/utils'
|
||||
import {
|
||||
buildProps,
|
||||
definePropType,
|
||||
isNumber,
|
||||
mutable,
|
||||
} from '@element-plus/utils'
|
||||
import type { Component, ExtractPropTypes } from 'vue'
|
||||
|
||||
export type ImageViewerAction =
|
||||
@ -40,7 +45,7 @@ export type ImageViewerProps = ExtractPropTypes<typeof imageViewerProps>
|
||||
|
||||
export const imageViewerEmits = {
|
||||
close: () => true,
|
||||
switch: (index: number) => typeof index === 'number',
|
||||
switch: (index: number) => isNumber(index),
|
||||
}
|
||||
export type ImageViewerEmits = typeof imageViewerEmits
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user