<picker class="pickerBox" :value="roomSituationIndex" @change="onConfirmPicker" :range="roomSituation" range-key="value" v-if="selectBuildingShow" > <view class="uni-input">{{roomSituation[roomSituationIndex].value}}</view> </picker>
roomSituation: [], 是一個數組對象
selectBuildingShow 是實時更新 回顯異步
roomSituationIndex 是下標
onConfirmPicker(e) {
//選擇的下標
let index = e.detail.value;
this.roomSituationIndex = index;
this.selectFloorNumber(index);
this.roomSelectList = [];
this.disType = true;
//取出對應的值
this.selectBuilding = this.roomSituation[index];
// this.roomSituationValue = this.roomSituation[index].id; 取id或者roomSituation中的其他值
// console.log(this.roomSituationValue) //樓宇回歸一樓 this.FloorSituationIndex = 0; this.roomFloorSave = 1; },