mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-25 15:59:16 +08:00
[bugfix] Toast: destroy instance in multiple mode (#1959)
This commit is contained in:
parent
2e8d7e0b4f
commit
9e2126bad8
@ -49,6 +49,11 @@ function Toast(options = {}) {
|
|||||||
...parseOptions(options),
|
...parseOptions(options),
|
||||||
clear() {
|
clear() {
|
||||||
toast.value = false;
|
toast.value = false;
|
||||||
|
|
||||||
|
if (!singleton && !isServer) {
|
||||||
|
document.body.removeChild(toast.$el);
|
||||||
|
toast.$destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,8 @@ transitionStub();
|
|||||||
|
|
||||||
test('create a forbidClick toast', async() => {
|
test('create a forbidClick toast', async() => {
|
||||||
const toast = Toast({
|
const toast = Toast({
|
||||||
forbidClick: true
|
forbidClick: true,
|
||||||
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user