update AutoComplete
This commit is contained in:
parent
b575fe2c6c
commit
9cc6213ca4
2 changed files with 13 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin: 100px;width: 200px;">
|
<div style="margin: 100px;width: 200px;">
|
||||||
<AutoComplete transfer v-model="value" :data="data" @on-search="handleSearch" @on-change="hc" :filter-method="fm">
|
<AutoComplete transfer v-model="value" clearable icon="ios-search" :data="data" @on-search="handleSearch" @on-change="hc" :filter-method="fm">
|
||||||
<!--<Option v-for="item in data" :value="item" :label="item" :key="item">-->
|
<!--<Option v-for="item in data" :value="item" :label="item" :key="item">-->
|
||||||
<!--<span style="color: red">{{ item }}</span>-->
|
<!--<span style="color: red">{{ item }}</span>-->
|
||||||
<!--</Option>-->
|
<!--</Option>-->
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:size="size"
|
:size="size"
|
||||||
:icon="closeIcon"
|
:icon="inputIcon"
|
||||||
@on-click="handleClear"
|
@on-click="handleClear"
|
||||||
@on-focus="handleFocus"
|
@on-focus="handleFocus"
|
||||||
@on-blur="handleBlur"></i-input>
|
@on-blur="handleBlur"></i-input>
|
||||||
|
@ -71,6 +71,9 @@
|
||||||
return oneOf(value, ['small', 'large', 'default']);
|
return oneOf(value, ['small', 'large', 'default']);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
icon: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
filterMethod: {
|
filterMethod: {
|
||||||
type: [Function, Boolean],
|
type: [Function, Boolean],
|
||||||
default: false
|
default: false
|
||||||
|
@ -87,8 +90,14 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
closeIcon () {
|
inputIcon () {
|
||||||
return this.clearable && this.currentValue ? 'ios-close' : '';
|
let icon = '';
|
||||||
|
if (this.clearable && this.currentValue) {
|
||||||
|
icon = 'ios-close';
|
||||||
|
} else if (this.icon) {
|
||||||
|
icon = this.icon;
|
||||||
|
}
|
||||||
|
return icon;
|
||||||
},
|
},
|
||||||
filteredData () {
|
filteredData () {
|
||||||
if (this.filterMethod) {
|
if (this.filterMethod) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue