refactor: update usePopupState
This commit is contained in:
+1
-6
@@ -1,4 +1,3 @@
|
||||
import { nextTick } from 'vue';
|
||||
import { inBrowser } from '../utils';
|
||||
import { mountComponent, usePopupState } from '../utils/mount-component';
|
||||
import VanDialog from './Dialog';
|
||||
@@ -35,17 +34,13 @@ function Dialog(options) {
|
||||
initInstance();
|
||||
}
|
||||
|
||||
instance.setState({
|
||||
instance.open({
|
||||
...Dialog.currentOptions,
|
||||
...options,
|
||||
callback: (action) => {
|
||||
(action === 'confirm' ? resolve : reject)(action);
|
||||
},
|
||||
});
|
||||
|
||||
nextTick(() => {
|
||||
instance.toggle(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user