diff --git a/packages/taro-components/types/Swiper.d.ts b/packages/taro-components/types/Swiper.d.ts index 621781353c19..92e3253c8078 100644 --- a/packages/taro-components/types/Swiper.d.ts +++ b/packages/taro-components/types/Swiper.d.ts @@ -103,6 +103,18 @@ interface SwiperProps extends StandardProps { */ disableTouch?: boolean + /** 是否启用缩放 + * @default false + * @supported h5 + */ + zoom?: boolean + + /** 是否开启全屏 + * @default false + * @supported h5 + */ + full?: boolean + /** swiper-item 可见时的 class。 * @supported alipay */ diff --git a/packages/taro-h5/src/api/media/image/previewImage.ts b/packages/taro-h5/src/api/media/image/previewImage.ts index 8de6aef50297..06902348a8ab 100644 --- a/packages/taro-h5/src/api/media/image/previewImage.ts +++ b/packages/taro-h5/src/api/media/image/previewImage.ts @@ -1,4 +1,5 @@ import Taro from '@tarojs/api' +import { SwiperProps } from '@tarojs/components' import { shouldBeObject } from '../../../utils' import { MethodHandler } from '../../../utils/handler' @@ -50,7 +51,7 @@ export const previewImage: typeof Taro.previewImage = async (options) => { container.remove() }) - const swiper = document.createElement('taro-swiper-core') + const swiper: HTMLElement & Omit = document.createElement('taro-swiper-core') // @ts-ignore swiper.full = true // @ts-ignore