uni-app picker select 取想要的值

<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; },
原文地址:https://www.cnblogs.com/Byme/p/12706044.html