| | |
| | | <template> |
| | | <div class="drop-down-search" @click.stop> |
| | | <view style="display: flex; align-items: center;"> |
| | | <!-- <u--input v-model="username" |
| | | <u--input |
| | | @focus="handleFocus" |
| | | @blur="closeDropDown" |
| | | :style="{height: '100%', paddingRight: clear? '60rpx' : '16rpx', display: 'flex' ,padding: '6px 9px', marginLeft:'8px'}" |
| | | v-model="searchText" |
| | | @input="handleSearch" |
| | | clearable |
| | | maxlength="32" |
| | | type="text" |
| | | placeholder="请输入手机号" |
| | | :placeholder="placeholder" |
| | | prefixIcon="account" |
| | | prefixIconStyle="font-size: 22px;color: #909399"></u--input> --> |
| | | <input |
| | | @focus="handleFocus" |
| | | @blur="closeDropDown" |
| | | :style="{height: '100%', paddingRight: clear? '60rpx' : '16rpx', display: 'flex'}" |
| | | type="text" |
| | | v-model="searchText" |
| | | @input="handleSearch" |
| | | :placeholder="placeholder"/> |
| | | |
| | | prefixIconStyle="font-size: 22px;color: #909399"></u--input> |
| | | <text v-if="searchText.length && clear" @click="handleClearInput" class="iconfont icon-shanchu"></text> |
| | | <view |
| | | @click="handleDropDownBox" |
| | |
| | | }, |
| | | // 处理搜索事件 |
| | | handleSearch(e) { |
| | | this.$emit('input', e.target.value); // 向父组件传递选中的值 |
| | | this.$emit('input', e); // 向父组件传递选中的值 |
| | | this.isDropDownVisible = this.hasOptions; |
| | | }, |
| | | handleFocus() { |