fixed #2066
This commit is contained in:
parent
485a9039d5
commit
45103ca480
2 changed files with 133 additions and 29 deletions
|
@ -84,24 +84,97 @@
|
||||||
<!--}-->
|
<!--}-->
|
||||||
<!--</script>-->
|
<!--</script>-->
|
||||||
|
|
||||||
|
<!--<template>-->
|
||||||
|
<!--<div style="width: 400px;margin: 50px;">-->
|
||||||
|
<!--<div>data: {{ model13 }}</div>-->
|
||||||
|
<!--<Row>-->
|
||||||
|
<!--<Col span="12" style="padding-right:10px">-->
|
||||||
|
<!--<Select-->
|
||||||
|
<!--size="small"-->
|
||||||
|
<!--placeholder="提示提示"-->
|
||||||
|
<!--v-model="model13"-->
|
||||||
|
<!--filterable-->
|
||||||
|
<!--remote-->
|
||||||
|
<!--transfer-->
|
||||||
|
<!--:remote-method="remoteMethod1"-->
|
||||||
|
<!--:loading="loading1">-->
|
||||||
|
<!--<Option v-for="(option, index) in options1" :value="option.value" :key="index">{{option.label}}</Option>-->
|
||||||
|
<!--</Select>-->
|
||||||
|
<!--</Col>-->
|
||||||
|
<!--<Col span="12">-->
|
||||||
|
<!--<Select-->
|
||||||
|
<!--v-model="model14"-->
|
||||||
|
<!--multiple-->
|
||||||
|
<!--filterable-->
|
||||||
|
<!--remote-->
|
||||||
|
<!--:remote-method="remoteMethod2"-->
|
||||||
|
<!--:loading="loading2">-->
|
||||||
|
<!--<Option v-for="(option, index) in options2" :value="option.value" :key="index">{{option.label}}</Option>-->
|
||||||
|
<!--</Select>-->
|
||||||
|
<!--</Col>-->
|
||||||
|
<!--</Row>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--</template>-->
|
||||||
|
<!--<script>-->
|
||||||
|
<!--export default {-->
|
||||||
|
<!--data () {-->
|
||||||
|
<!--return {-->
|
||||||
|
<!--model13: '',-->
|
||||||
|
<!--loading1: false,-->
|
||||||
|
<!--options1: [],-->
|
||||||
|
<!--model14: [],-->
|
||||||
|
<!--loading2: false,-->
|
||||||
|
<!--options2: [],-->
|
||||||
|
<!--list: ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New hampshire', 'New jersey', 'New mexico', 'New york', 'North carolina', 'North dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode island', 'South carolina', 'South dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West virginia', 'Wisconsin', 'Wyoming']-->
|
||||||
|
<!--}-->
|
||||||
|
<!--},-->
|
||||||
|
<!--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 = [];-->
|
||||||
|
<!--}-->
|
||||||
|
<!--}-->
|
||||||
|
<!--}-->
|
||||||
|
<!--}-->
|
||||||
|
<!--</script>-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div style="width: 400px;margin: 50px;">
|
<div>
|
||||||
<div>data: {{ model13 }}</div>
|
{{ model10 }}
|
||||||
<Row>
|
<Select v-model="model10" multiple style="width:260px">
|
||||||
<Col span="12" style="padding-right:10px">
|
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||||
<Select
|
|
||||||
size="small"
|
|
||||||
placeholder="提示提示"
|
|
||||||
v-model="model13"
|
|
||||||
filterable
|
|
||||||
remote
|
|
||||||
transfer
|
|
||||||
:remote-method="remoteMethod1"
|
|
||||||
:loading="loading1">
|
|
||||||
<Option v-for="(option, index) in options1" :value="option.value" :key="index">{{option.label}}</Option>
|
|
||||||
</Select>
|
</Select>
|
||||||
</Col>
|
----------
|
||||||
<Col span="12">
|
{{ model14 }}
|
||||||
<Select
|
<Select
|
||||||
v-model="model14"
|
v-model="model14"
|
||||||
multiple
|
multiple
|
||||||
|
@ -111,14 +184,40 @@
|
||||||
:loading="loading2">
|
:loading="loading2">
|
||||||
<Option v-for="(option, index) in options2" :value="option.value" :key="index">{{option.label}}</Option>
|
<Option v-for="(option, index) in options2" :value="option.value" :key="index">{{option.label}}</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Col>
|
<Button @click="clear">clear</Button>
|
||||||
</Row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
cityList: [
|
||||||
|
{
|
||||||
|
value: 'beijing',
|
||||||
|
label: '北京市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'shanghai',
|
||||||
|
label: '上海市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'shenzhen',
|
||||||
|
label: '深圳市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'hangzhou',
|
||||||
|
label: '杭州市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'nanjing',
|
||||||
|
label: '南京市'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'chongqing',
|
||||||
|
label: '重庆市'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
model10: [],
|
||||||
model13: '',
|
model13: '',
|
||||||
loading1: false,
|
loading1: false,
|
||||||
options1: [],
|
options1: [],
|
||||||
|
@ -162,6 +261,9 @@
|
||||||
} else {
|
} else {
|
||||||
this.options2 = [];
|
this.options2 = [];
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
clear () {
|
||||||
|
this.model14 = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
|
|
||||||
const selectedArray = [];
|
const selectedArray = [];
|
||||||
const selectedObject = {};
|
const selectedObject = {};
|
||||||
|
|
||||||
selected.forEach(item => {
|
selected.forEach(item => {
|
||||||
if (!selectedObject[item.value]) {
|
if (!selectedObject[item.value]) {
|
||||||
selectedArray.push(item);
|
selectedArray.push(item);
|
||||||
|
@ -376,7 +377,8 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.selectedMultiple = this.remote ? selectedArray : selected;
|
// #2066
|
||||||
|
this.selectedMultiple = this.remote ? this.model.length ? selectedArray : [] : selected;
|
||||||
|
|
||||||
if (slot) {
|
if (slot) {
|
||||||
let selectedModel = [];
|
let selectedModel = [];
|
||||||
|
|
Loading…
Add table
Reference in a new issue