-
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { AllowedComponentProps, VNodeProps } from './_common'
 
declare interface NotifyProps {
  /**
   * 到顶部的距离
   * @default 0
   */
  top?: string | number
  /**
   * 主题
   * @default "primary"
   */
  type?: 'primary' | 'success' | 'warning' | 'error'
  /**
   * 字体颜色
   * @default "#fff"
   */
  color?: string
  /**
   * 背景颜色
   */
  bgColor?: string
  /**
   * 展示的文字内容
   */
  message?: string
  /**
   * 展示时长,为0时不消失,单位ms
   * @default 3000
   */
  duration?: string | number
  /**
   * 字体大小,单位rpx
   * @default 15
   */
  fontSize?: string | number
  /**
   * 是否留出顶部安全距离(状态栏高度)
   * @default false
   */
  safeAreaInsetTop?: boolean
}
 
declare interface NotifySlots {
  /**
   * 通知内容
   */
  ['icon']?: () => any
}
 
declare interface _NotifyRef {
  /**
   * 显示并加载配置
   */
  show: (options: NotifyProps) => void
  /**
   * 关闭消息提示
   */
  close: () => void
}
 
declare interface _Notify {
  new (): {
    $props: AllowedComponentProps &
      VNodeProps &
      NotifyProps
    $slots: NotifySlots
  }
}
 
export declare const Notify: _Notify
 
export declare const NotifyRef: _NotifyRef