feat(ImagePreview): add swipeTo method (#6596)

This commit is contained in:
来铧敏
2020-06-22 20:47:04 +08:00
committed by GitHub
parent 60fb4cc7bc
commit bd1279bc7d
6 changed files with 76 additions and 0 deletions

View File

@@ -405,6 +405,14 @@ export default createComponent({
onClosed() {
this.$emit('closed');
},
// @exposed-api
swipeTo(index, options) {
if (!this.$refs.swipe) {
return;
}
this.$refs.swipe.swipeTo(+index, options);
},
},
render() {