mirror of
https://github.com/youzan/vant.git
synced 2026-05-06 01:00:26 +08:00
refactor: update usePopupState
This commit is contained in:
+1
-6
@@ -1,4 +1,3 @@
|
||||
import { nextTick } from 'vue';
|
||||
import { isObject, inBrowser } from '../utils';
|
||||
import { mountComponent, usePopupState } from '../utils/mount-component';
|
||||
import VanNotify from './Notify';
|
||||
@@ -40,17 +39,13 @@ function Notify(options) {
|
||||
...parseOptions(options),
|
||||
};
|
||||
|
||||
instance.setState(options);
|
||||
instance.open(options);
|
||||
clearTimeout(timer);
|
||||
|
||||
if (options.duration && options.duration > 0) {
|
||||
timer = setTimeout(Notify.clear, options.duration);
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
instance.toggle(true);
|
||||
});
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user