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
| <template>
| <view class="search">
| <view class="content">
| <view class="search_wrap">
| <slot name="prefix"></slot>
| <view style="flex: 1;">
| <u-search :placeholder="placeholder" :showAction="false" :clearabled="false" :value='value'
| @change="change" @search="search"></u-search>
| </view>
| <slot name="suffix"></slot>
| </view>
| </view>
| </view>
| </template>
|
| <script>
| export default {
| props: {
| width: {
| type: Number,
| // default: 400,
| },
| placeholder: {
| type: String,
| default: "请输入"
| },
| value: {
| type: String,
| required: true
| },
| padding: {
| type: String,
| default: "0 40rpx"
| }
| },
| methods: {
| change(e) {
| this.$emit("input", e)
| },
| search(e) {
| this.$emit("search", e)
| },
| }
| }
| </script>
|
| <style lang="scss" scoped>
| .search {
| // width: 675rpx;
|
| .content {
| // width: 90%;
| // padding: var(--val);
| box-sizing: border-box;
| padding: 0 40rpx;
|
| .search_wrap {
| display: flex;
| align-items: center;
| // justify-content: flex-start;
| width: 100%;
| box-sizing: border-box;
| background: #f2f2f2;
| border-radius: 8rpx;
| min-height: 72rpx;
| }
| }
| }
| </style>
|
|