<Select v-model="model10" multiple style="width:260px">
<Option v-for="item in cityList" :value="item.value" :key="item.value" @click.native=""绑定事件>{{ item.label }}</Option>
</Select>
给option添加点击事件来获取 数组中的对象 @click.native=""绑定事件
将label和value一起返回 :label-in-value="true"
<template>
<Select v-model="model1" style="width:200px" @on-change='change_status' :label-in-value="true">
<Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</template>
<script>
export default {
data () {
return {
cityList: [
{
value: 'New York',
label: 'New York'
},
{
value: 'London',
label: 'London'
},
{
value: 'Sydney',
label: 'Sydney'
},
{
value: 'Ottawa',
label: 'Ottawa'
},
{
value: 'Paris',
label: 'Paris'
},
{
value: 'Canberra',
label: 'Canberra'
}
],
model1: ''
}
},
methods:{ change_status(v){ console.log('label-value:==',v) // } }
}
</script>