[bugfix] Toast: destroy instance in multiple mode (#1959)
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user