[new feature] ImagePreview: add onChange option (#3630)

This commit is contained in:
neverland
2019-06-25 15:49:17 +08:00
committed by GitHub
parent 045c75669b
commit fbd751a641
7 changed files with 64 additions and 13 deletions

View File

@@ -24,6 +24,12 @@ const initInstance = () => {
el: document.createElement('div')
});
document.body.appendChild(instance.$el);
instance.$on('change', index => {
if (instance.onChange) {
instance.onChange(index);
}
});
};
const ImagePreview = (images, startPosition = 0) => {