-
zhangwei
2025-03-05 16213c0f85aa3ac8317797bf4a05fd12940e16d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { AllowedComponentProps, VNodeProps } from './_common'
 
declare interface ToastProps {
  /**
   * 是否加载中
   * @default false
   */
  loading?: boolean
  /**
   * 显示的文本
   */
  message?: string | number
  /**
   * 图标,或者绝对路径的图片
   */
  icon?: string
  /**
   * toast出现的位置
   * @default "center"
   */
  position?: 'top' | 'center' | 'bottom'
  /**
   * 主题类型
   * @default "default"
   */
  type?: 'default' | 'error' | 'success' | 'loading'
  /**
   * 跳转的参数
   */
  params?: Record<string, any>
  /**
   * 展示时间,单位ms
   * @default 2000
   */
  duration?: string | number
  /**
   * 执行完后的回调函数
   */
  complete?: () => any
}
 
declare interface _ToastRef {
  /**
   * 显示toast,如需一进入页面就显示toast,请在onReady生命周期调用
   */
  show: () => void
}
 
declare interface _Toast {
  new (): {
    $props: AllowedComponentProps &
      VNodeProps &
      ToastProps
  }
}
 
export declare const Toast: _Toast
 
export declare const ToastRef: _ToastRef