feat: utils-showToast 完善函数类型定义,添加重载
This commit is contained in:
@@ -18,8 +18,12 @@ interface ToastOptions {
|
||||
*/
|
||||
mask?: boolean
|
||||
}
|
||||
|
||||
export function showToast(options: ToastOptions | string) {
|
||||
/**
|
||||
* 显示 toast
|
||||
*/
|
||||
export function showToast(message: string): void
|
||||
export function showToast(options: ToastOptions): void
|
||||
export function showToast(options: ToastOptions | string): void {
|
||||
const defaultOptions: ToastOptions = {
|
||||
type: 'info',
|
||||
duration: 2000,
|
||||
|
||||
Reference in New Issue
Block a user