2023-06-25:perf: ImageViewer组件优化

(cherry picked from commit fe61119735)
pull/420/head
YunaiV 2024-02-29 19:39:58 +08:00 committed by shizhong
parent 6a3a215768
commit c468d77fb9
3 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ export function createImageViewer(options: ImageViewerProps) {
initialIndex = 0, initialIndex = 0,
infinite = true, infinite = true,
hideOnClickModal = false, hideOnClickModal = false,
appendToBody = false, teleported = false,
zIndex = 2000, zIndex = 2000,
show = true show = true
} = options } = options
@ -23,7 +23,7 @@ export function createImageViewer(options: ImageViewerProps) {
propsData.initialIndex = initialIndex propsData.initialIndex = initialIndex
propsData.infinite = infinite propsData.infinite = infinite
propsData.hideOnClickModal = hideOnClickModal propsData.hideOnClickModal = hideOnClickModal
propsData.appendToBody = appendToBody propsData.teleported = teleported
propsData.zIndex = zIndex propsData.zIndex = zIndex
propsData.show = show propsData.show = show

View File

@ -13,7 +13,7 @@ const props = defineProps({
initialIndex: propTypes.number.def(0), initialIndex: propTypes.number.def(0),
infinite: propTypes.bool.def(true), infinite: propTypes.bool.def(true),
hideOnClickModal: propTypes.bool.def(false), hideOnClickModal: propTypes.bool.def(false),
appendToBody: propTypes.bool.def(false), teleported: propTypes.bool.def(false),
show: propTypes.bool.def(false) show: propTypes.bool.def(false)
}) })

View File

@ -4,6 +4,6 @@ export interface ImageViewerProps {
initialIndex?: number initialIndex?: number
infinite?: boolean infinite?: boolean
hideOnClickModal?: boolean hideOnClickModal?: boolean
appendToBody?: boolean teleported?: boolean
show?: boolean show?: boolean
} }