diff --git a/packages/vant-compat/src/dialog.ts b/packages/vant-compat/src/dialog.ts index d2d8c8516..acc78dbf5 100644 --- a/packages/vant-compat/src/dialog.ts +++ b/packages/vant-compat/src/dialog.ts @@ -13,7 +13,7 @@ export const Dialog = (...args: Parameters) => Dialog.Component = VanDialog; Dialog.alert = Dialog; -Dialog.config = showConfirmDialog; +Dialog.confirm = showConfirmDialog; Dialog.close = closeDialog; Dialog.setDefaultOptions = setDialogDefaultOptions; Dialog.resetDefaultOptions = resetDialogDefaultOptions; diff --git a/packages/vant-compat/src/toast.ts b/packages/vant-compat/src/toast.ts index e22373a70..2dc7302b8 100644 --- a/packages/vant-compat/src/toast.ts +++ b/packages/vant-compat/src/toast.ts @@ -3,6 +3,7 @@ import { closeToast, showFailToast, showSuccessToast, + showLoadingToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, @@ -33,6 +34,14 @@ Toast.success = (...args: Parameters) => { }; }; +Toast.loading = (...args: Parameters) => { + const toast = showLoadingToast(...args); + return { + clear: toast.close, + ...toast, + } +} + Toast.clear = closeToast; Toast.allowMultiple = allowMultipleToast; Toast.setDefaultOptions = setToastDefaultOptions;