SearchBox.vue
1.71 KB
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
<template>
<div class="search-box flex">
<van-search
v-model="keyword"
placeholder="输入客户姓名搜索"
@search="onSearch"
/>
<van-dropdown-menu active-color="#5850ff">
<van-dropdown-item
v-model="value"
:options="option"
@change="change"
/>
<div class="arrow y-center">
<div class="sprite-icon icon-down"></div>
</div>
</van-dropdown-menu>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'SearchBox',
props: ['keyword'],
data () {
return {
value: 0,
option: [
{ text: '优惠券', value: 0 },
{ text: '精品礼券', value: 1 }
]
}
},
mounted () {
},
methods: {
change (e) {
this.$emit('change', e)
},
onSearch (e) {
this.$emit('search', e)
}
}
}
</script>
<style lang='scss'>
.search-box {
height: 50px;
background: #fff;
box-shadow: 0px 1px 0px 0px #e9e9e9;
padding-right: 16px;
position: relative;
.van-search {
width: 263px;
padding: 4.5px 8px;
height: 100%;
background: #fff;
.van-search__content {
background-color: #fff;
border: 1px solid #cdd1d4;
border-radius: 16px;
}
}
.van-dropdown-menu {
margin-left: auto;
.arrow {
right: 8px;
z-index: 998;
}
.van-dropdown-menu__bar--opened ~ .arrow .sprite-icon {
transform: rotate(-180deg);
transition: all 0.25s;
}
.van-dropdown-menu__bar {
background-color: #fff;
box-shadow: none;
.van-dropdown-menu__title {
color: #545454 !important;
font-size: 16px;
&::after {
display: none;
}
}
}
}
}
</style>