This commit is contained in:
梁灏 2017-08-21 16:35:48 +08:00
parent 6c912a7b14
commit f8098275ca
2 changed files with 17 additions and 44 deletions

View file

@ -1,16 +1,22 @@
<template> <template>
<i-select transfer multiple v-model="m1"> <Row>
<i-option v-for="item in options" :value="item.value" :key="item.value">{{ item.label }}</i-option> <Col span="12" style="padding-right:10px">
</i-select> <Select v-model="model11" :disabled="false" filterable>
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</Col>
<Col span="12">
<Select v-model="model12" filterable :disabled="true" multiple>
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</Col>
</Row>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
m1: [], cityList: [
showModal: false,
showModal2: false,
options: [
{ {
value: 'beijing', value: 'beijing',
label: '北京市' label: '北京市'
@ -35,43 +41,9 @@
value: 'chongqing', value: 'chongqing',
label: '重庆市' label: '重庆市'
} }
] ],
} model11: '',
}, model12: []
methods: {
remoteMethod1 (query) {
if (query !== '') {
this.loading1 = true;
setTimeout(() => {
this.loading1 = false;
const list = this.list.map(item => {
return {
value: item,
label: item
};
});
this.options1 = list.filter(item => item.label.toLowerCase().indexOf(query.toLowerCase()) > -1);
}, 200);
} else {
this.options1 = [];
}
},
remoteMethod2 (query) {
if (query !== '') {
this.loading2 = true;
setTimeout(() => {
this.loading2 = false;
const list = this.list.map(item => {
return {
value: item,
label: item
};
});
this.options2 = list.filter(item => item.label.toLowerCase().indexOf(query.toLowerCase()) > -1);
}, 200);
} else {
this.options2 = [];
}
} }
} }
} }

View file

@ -14,6 +14,7 @@
type="text" type="text"
v-if="filterable" v-if="filterable"
v-model="query" v-model="query"
:disabled="disabled"
:class="[prefixCls + '-input']" :class="[prefixCls + '-input']"
:placeholder="showPlaceholder ? localePlaceholder : ''" :placeholder="showPlaceholder ? localePlaceholder : ''"
:style="inputStyle" :style="inputStyle"