vue
<select style="border: solid 0px #fff;background-color:rgba(11,11,11,0);margin-right: 30px;color:#fff;font-size: 20px;width: 100px;" @change="switchAR">
<option v-for="item in ARList" :value="item.value" style="color:#666;margin: 0px" >
{{ item.label }}
</option>
</select>
//1、用v-model="ARModel.id"会出问题,理解v-model和@change的区别与相同
js
//on-change事件
switchAR(item) {
console.log(item.target.value)
for(let i=0;i<this.ARList.length;i++){
if(this.ARList[i].id == item.target.value) {
console.log(this.ARList[i])
this.ARModel = this.ARList[i];
this.selectedPoint = {};
this.updateViewPoint();
}
}
},
//更新事件
updateViewPoint() {
this.Api.get('/visualization/view', {
params: {
modelId: this.ARModel.id,
img:'',
id: '',
name: ''
}
}
).then((res)=>{
this.viewPointList = res.viewDTOs;//表格数据切换
this.ARImg=this.ARModel.img;//视图切换
}).catch((err)=>{
});
},