refactor: update usePopupState

This commit is contained in:
chenjiahan
2020-09-01 09:47:59 +08:00
parent c4921da290
commit 6e6cfe5c65
6 changed files with 37 additions and 51 deletions
+1 -6
View File
@@ -1,4 +1,3 @@
import { nextTick } from 'vue';
import { inBrowser } from '../utils';
import { mountComponent, usePopupState } from '../utils/mount-component';
import VanImagePreview from './ImagePreview';
@@ -60,15 +59,11 @@ const ImagePreview = (images, startPosition = 0) => {
const options = Array.isArray(images) ? { images, startPosition } : images;
instance.setState({
instance.open({
...defaultConfig,
...options,
});
nextTick(() => {
instance.toggle(true);
});
return instance;
};