May 18, 2021 WeChat Mini Program Development Document
The base library 2.12.0 starts to support, and the lower version needs to be compatible.
Preview pictures and videos.
Property | Type | The default | Required | Description |
---|---|---|---|---|
sources | Array.<Object> | Is | A list of resources that need to be previewed | |
current | current | 0 | Whether | The resource serial number that is currently displayed |
success | function | Whether | The interface calls a successful callback function | |
fail | function | Whether | The interface calls the failed callback function | |
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
The structure of object.sources
Property | Type | The default | Required | Description |
---|---|---|---|---|
Url | String | Is | The address of the picture or video | |
type | String | image | Whether | The type of resource, which defaults to a picture |
poster | string | Whether | The cover image of the video |
The legal value of type
Value | Description | The lowest version |
---|---|---|
image | Image | |
video | Video |