import { use, isAndroid } from '../utils'; import Cell from '../cell'; import Field from '../field'; const [sfc, bem, t] = use('address-edit-detail'); const android = isAndroid(); export default sfc({ props: { value: String, error: Boolean, focused: Boolean, detailRows: Number, searchResult: Array, showSearchResult: Boolean }, computed: { searchList() { if (this.showSearchResult && this.focused) { return this.searchResult || []; } return []; }, showIcon() { return this.value && this.focused; } }, methods: { onSelect(express) { this.$emit('select-search', express); this.$emit('input', `${express.address || ''} ${express.name || ''}`.trim()); } }, render(h) { return ( {this.showIcon && android && (
{ this.$refs.field.blur(); }} > {t('complete')}
)}
{this.searchList.map(express => ( { this.onSelect(express); }} /> ))} ); } });