chore(Toast): improve clear method

This commit is contained in:
chenjiahan 2020-09-01 09:52:42 +08:00
parent 6e6cfe5c65
commit 4ddf4e7018
2 changed files with 3 additions and 6 deletions

View File

@ -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,

View File

@ -26,6 +26,7 @@ export function usePopupState() {
return {
open,
close,
state,
toggle,
};