怎么指定行政区三级联动选择器的选中数值?

发布于 8 年前作者 yonglu2190 次浏览最后编辑 8 年前来自 issues

 <picker mode=“region” bindchange=“bindRegionChange” value=“{{region}}” custom-item=“{{customItem}}”>

    <view class=“picker”>

      {{region[0]}}{{region[1]}}{{region[2]}}

    </view>

  </picker>

怎么根据当前坐标获取的区县,设置选择器的数值呢?谢谢

1 回复
wangming
wangming1 楼5 年前

  bindRegionChange(e) {

    this.setData({

      region: e.detail.value

    });

    //省市区如下

    console.log('region[0]'+this.data.region[0]);

    console.log('region[1]'+this.data.region[1]);

    console.log('region[2]'+this.data.region[2]);

  },