学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
1.3 KiB

<template>
<view class="searchBg">
<view class="flex">
<view class="searchIcon">
<image src="@/static/images/index/searchIcon.png" mode=""></image>
</view>
<view class="inputBox" v-if="disable">
<view class="textColor">{{ placeholder }}</view>
</view>
<view class="inputBox" v-else>
<u-search :placeholder="placeholder" v-model="keyword" :color="'#fff'" placeholderColor="#fff" :bgColor="'transparent'" :showAction="false" @search="$u.debounce(searchFn, 500)" @clear="clearSearchFn"></u-search>
</view>
</view>
</view>
</template>
<script>
export default {
props: ['placeholder', 'disable'],
data() {
return {
keyword: ''
}
},
methods: {
searchFn() {
this.$emit('searchFn', this.keyword)
},
clearSearchFn() {
this.keyword = ''
this.$emit('searchFn', '')
}
}
}
</script>
<style lang="scss" scoped>
.searchBg {
background: #8ABAED;
width: 100%;
height: 72rpx;
border-radius: 16rpx;
line-height: 72rpx;
.flex {
height: 100%;
padding: 0 28rpx;
.searchIcon {
width: 40rpx;
height: 40rpx;
}
.inputBox {
flex: 1;
color: #fff;
font-size: 28rpx;
}
}
}
.textColor {
font-size: 26rpx;
color: #fff;
line-height: 72rpx;
padding-left: 14rpx;
}
</style>