mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
feat: add clear method
This commit is contained in:
@@ -5,9 +5,8 @@ const ToastConstructor = Vue.extend(require('./toast.vue'));
|
||||
let instance;
|
||||
|
||||
const getInstance = () => {
|
||||
if (instance) {
|
||||
instance.clear();
|
||||
}
|
||||
if (instance) instance.clear();
|
||||
|
||||
instance = new ToastConstructor({
|
||||
el: document.createElement('div')
|
||||
});
|
||||
@@ -70,4 +69,8 @@ Toast.fail = (options) => {
|
||||
}, options));
|
||||
};
|
||||
|
||||
Toast.clear = () => {
|
||||
if (instance) instance.clear();
|
||||
}
|
||||
|
||||
export default Toast;
|
||||
|
Reference in New Issue
Block a user