1. The code in.wxml file is as follows:
<view class="wxPicker"> </view> <picker mode="region" bindchange="bindRegionChange" value="{{detailed}}" custom-item="{{customItem}}" name="detailed"> <view class="wxAddress">{{detailed}}</view> </picker> </view>Copy the code
2. The code in the.js file is as follows:
Data: {customItem: [], Detailed: 'Click to select address ',} /** * life cycle function -- listen to page load */ onLoad: Function (options) {}, // Provincial linkage: Function (e) {var that = this console.log('picker sends selection changes, Value) this.setData({" // Detailed "string is sent to the background: Value [0] + "" + e.dael. value[1] +" "+ e.dael. value[2], // The value region selected in the drop-down box: e.detail.value }) this.setData({ "AddSite.area": e.detail.value[0] + " " + e.detail.value[1] + " " + e.detail.value[2] }) console.log(this.data.AddSite) },Copy the code