2016-10-17 12:34:20 +08:00
|
|
|
<template>
|
2017-09-01 15:44:33 +08:00
|
|
|
<div>
|
|
|
|
<h4>有remote属性</h4>
|
|
|
|
{{ selectedIds }}
|
|
|
|
<i-select remote clearable filterable multiple :label="selectedLabel" v-model="selectedIds" style='margin-bottom:20px;'>
|
|
|
|
<i-option v-for="option in list" :value="option.id" :key="option.id">{{option.name}}</i-option>
|
|
|
|
</i-select>
|
|
|
|
<i-button @click="setVal3">设置3</i-button>
|
|
|
|
</div>
|
2016-10-17 12:34:20 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2017-09-01 15:44:33 +08:00
|
|
|
list: [],
|
|
|
|
selectedIds: [],
|
|
|
|
selectedLabel: []
|
2016-10-17 12:34:20 +08:00
|
|
|
}
|
2017-09-01 15:44:33 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
setVal1: function () {
|
|
|
|
this.selectedLabel = ['几何', '化学'];
|
|
|
|
this.selectedIds = ['201701041343', '201701011541']
|
|
|
|
|
|
|
|
},
|
|
|
|
setVal2: function () {
|
|
|
|
this.selectedLabel = ['政治', '英语', '数学'];
|
|
|
|
this.selectedIds = ['201701031442', '201701061244', '201701011145']
|
|
|
|
},
|
|
|
|
setVal3: function () {
|
|
|
|
this.selectedLabel = [];
|
|
|
|
this.selectedIds = [];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.list = [{
|
|
|
|
name: '语文',
|
|
|
|
id: '201701011046'
|
|
|
|
}, {
|
|
|
|
name: '数学',
|
|
|
|
id: '201701011145'
|
|
|
|
}, {
|
|
|
|
name: '英语',
|
|
|
|
id: '201701061244'
|
|
|
|
}, {
|
|
|
|
name: '几何',
|
|
|
|
id: '201701041343'
|
|
|
|
}, {
|
|
|
|
name: '政治',
|
|
|
|
id: '201701031442'
|
|
|
|
}, {
|
|
|
|
name: '化学',
|
|
|
|
id: '201701011541'
|
|
|
|
}]
|
|
|
|
}, 1000)
|
2016-10-17 12:34:20 +08:00
|
|
|
}
|
|
|
|
}
|
2017-05-19 10:49:47 +08:00
|
|
|
</script>
|