-
zhangwei
2024-09-10 38130802e3fd55080f518f4128ef20ddfdd907c3
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import { AllowedComponentProps, VNodeProps } from './_common'
 
 
declare interface SearchProps {
  /**
   * 双向绑定输入框搜索值
   */
  ['v-model']?: string
  /**
   * 搜索框形状,round-圆形,square-方形
   * @default "round"
   */
  shape?: 'round' | 'square'
  /**
   * 搜索框背景颜色
   * @default "#f2f2f2"
   */
  bgColor?: string
  /**
   * 占位文字内容
   * @default "请输入关键字"
   */
  placeholder?: string
  /**
   * 是否启用清除控件
   * @default true
   */
  clearabled?: boolean
  /**
   * 是否自动获得焦点
   * @default false
   */
  focus?: boolean
  /**
   * 是否显示右侧控件(右侧的"搜索"按钮)
   * @default true
   */
  showAction?: boolean
  /**
   * 右侧控件的样式,对象形式
   */
  actionStyle?: unknown
  /**
   * 右侧控件文字
   * @default "搜索"
   */
  actionText?: string
  /**
   * 输入框内容水平对齐方式
   * @default "left"
   */
  inputAlign?: 'left' | 'center'  |'right'
  /**
   * 自定义输入框样式,对象形式
   */
  inputStyle?: unknown
  /**
   * 是否启用输入框
   * @default false
   */
  disabled?: boolean
  /**
   * 边框颜色,配置了颜色,才会有边框
   * @default "transparent"
   */
  borderColor?: string
  /**
   * 搜索图标的颜色,默认同输入框字体颜色
   * @default "#909399"
   */
  searchIconColor?: string
  /**
   * 搜索图标的大小
   * @default 22
   */
  searchIconSize?: number
  /**
   * 输入框字体颜色
   * @default "#606266"
   */
  color?: string
  /**
   * placeholder的颜色
   * @default "#909399"
   */
  placeholderColor?: string
  /**
   * 输入框左边的图标,可以为uView图标名称或图片路径
   * @default "search"
   */
  searchIcon?: string
  /**
   * 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30rpx"、"30rpx 20rpx"等写法
   * @default "0"
   */
  margin?: string
  /**
   * 是否开启动画,详见[文档](https://www.uviewui.com/components/search.html#%E6%98%AF%E5%90%A6%E5%BC%80%E5%90%AF%E5%8F%B3%E8%BE%B9%E6%8E%A7%E4%BB%B6)
   * @default false
   */
  animation?: boolean
  /**
   * 输入框初始值
   */
  value?: string
  /**
   * 输入框最大能输入的长度,-1为不限制长度
   * @default -1
   */
  maxlength?: string | number
  /**
   * 输入框高度,单位rpx
   * @default 64
   */
  height?: string | number
  /**
   * 搜索左侧文本信息
   */
  label?: string | number
  /**
   * 输入框内容发生变化时触发
   * @param value 输入框的值
   */
  onChange?: (value: any) => any
  /**
   * 用户确定搜索时触发,用户按回车键,或者手机键盘右下角的"搜索"键时触发
   * @param value 输入框的值
   */
  onSearch?: (value: any) => any
  /**
   * 用户点击右侧控件时触发
   * @param value 输入框的值
   */
  onCustom?: (value: any) => any
  /**
   * 输入框失去焦点时触发
   * @param value 输入框的值
   */
  onBlur?: (value: any) => any
  /**
   * 输入框获得焦点时触发
   * @param value 输入框的值
   */
  onFocus?: (value: any) => any
  /**
   * 配置了`clearabled`后,清空内容时会发出此事件
   */
  onClear?: () => any
  /**
   * `disabled`为`true`时,点击输入框,发出此事件,用于跳转搜索页
   */
  onClick?: () => any
  /**
   * 左侧icon点击时候时触发
   */
  onClickIcon?: () => any
}
 
declare interface _Search {
  new (): {
    $props: AllowedComponentProps &
      VNodeProps &
      SearchProps
  }
}
 
export declare const Search: _Search