提交 | 用户 | 时间
|
820397
|
1 |
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' |
H |
2 |
|
|
3 |
/** 搜索框属性 */ |
|
4 |
export interface SearchProperty { |
|
5 |
height: number // 搜索栏高度 |
|
6 |
showScan: boolean // 显示扫一扫 |
|
7 |
borderRadius: number // 框体样式 |
|
8 |
placeholder: string // 占位文字 |
|
9 |
placeholderPosition: PlaceholderPosition // 占位文字位置 |
|
10 |
backgroundColor: string // 框体颜色 |
|
11 |
textColor: string // 字体颜色 |
|
12 |
hotKeywords: string[] // 热词 |
|
13 |
style: ComponentStyle |
|
14 |
} |
|
15 |
|
|
16 |
// 文字位置 |
|
17 |
export type PlaceholderPosition = 'left' | 'center' |
|
18 |
|
|
19 |
// 定义组件 |
|
20 |
export const component = { |
|
21 |
id: 'SearchBar', |
|
22 |
name: '搜索框', |
|
23 |
icon: 'ep:search', |
|
24 |
property: { |
|
25 |
height: 28, |
|
26 |
showScan: false, |
|
27 |
borderRadius: 0, |
|
28 |
placeholder: '搜索商品', |
|
29 |
placeholderPosition: 'left', |
|
30 |
backgroundColor: 'rgb(238, 238, 238)', |
|
31 |
textColor: 'rgb(150, 151, 153)', |
|
32 |
hotKeywords: [], |
|
33 |
style: { |
|
34 |
bgType: 'color', |
|
35 |
bgColor: '#fff', |
|
36 |
marginBottom: 8, |
|
37 |
paddingTop: 8, |
|
38 |
paddingRight: 8, |
|
39 |
paddingBottom: 8, |
|
40 |
paddingLeft: 8 |
|
41 |
} as ComponentStyle |
|
42 |
} |
|
43 |
} as DiyComponent<SearchProperty> |