diff --git a/src/toast/index.js b/src/toast/index.js index 7f4f4a9c3..8652e2082 100644 --- a/src/toast/index.js +++ b/src/toast/index.js @@ -42,11 +42,7 @@ function createInstance() { const { instance, unmount } = mountComponent({ setup() { const message = ref(); - const { open, state, toggle } = usePopupState(); - - const clear = () => { - toggle(false); - }; + const { open, state, close, toggle } = usePopupState(); const onClosed = () => { if (allowMultiple) { @@ -61,8 +57,8 @@ function createInstance() { return { open, - clear, state, + clear: close, toggle, message, onClosed, diff --git a/src/utils/mount-component.ts b/src/utils/mount-component.ts index bdbf7c9be..3ffb47ce6 100644 --- a/src/utils/mount-component.ts +++ b/src/utils/mount-component.ts @@ -26,6 +26,7 @@ export function usePopupState() { return { open, + close, state, toggle, };