方法一:
<el-select v-model="value" placeholder="请选择" @change="change()">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
在el-select中添加@change="change()
change(){
this.$forceUpdate()
}
方法二:
@change="currentSelect"
*******************************************
currentSelect(val) {
this.$forceUpdate()
console.log('选中的', val)
if (val) {
let obj = {}
obj = this.options.find((item) => {
return item.value === val //筛选出匹配数据
})
this.$set('', this.roadMark, val.value)
this.value = obj.label
console.log('选中的是', obj.label)
} else {
this.value = ''
// this.$set('',this.roadMark, '')
}
},
方法三:
<el-table-column prop="roadMark"
label="标记">
<template slot-scope="scope">
<el-select v-model="scope.row[scope.column.property]"
clearable
placeholder="请选择"
@change="currentSelect">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
前后加上template这个 解决