//index.wxml <picker mode="region" bindchange="bindRegionChange" value="{{region}}"> <view class="picker"> 当前选择:{{region[0]}},{{region[1]}},{{region[2]}} view> picker> //index.js data: { region: ['广东省', '广州市', '海珠区'] }
<picker mode="multiSelector" value="{{index}}" bindcolumnchange="bindPickerChange" range="{{province}}" range-key="{{'name'}}"> <view class="picker"> 当前选择:{{province[0][0].name}}{{province[1][0].name}} view> picker>
// picker.js var cityObj = require("../../utils/city") Page({ data: { index: 0 }, onLoad: function (options) { var defaultCitys = cityObj.getCitysById("0") this.setData({ province: [cityObj.provinceList, defaultCitys] }) }, bindPickerChange(e) { if (e.detail.column == 0) { var citys = cityObj.getCitysById(e.detail.value); this.setData({ province: [cityObj.provinceList, citys] }) } } })
<picker mode="time" value="{{time}}" start="09:01" end="21:01" bindchange="bindTimeChange"> <view class="picker"> 当前选择: {{time}} view> picker>
<picker mode="date" value="{{time}}" start="2015-09-01" end="2017-09-01" fields="month" bindchange="bindTimeChange"> <view class="picker"> 当前选择: {{time}} view> picker>
<rich-text nodes="{{nodes}}" /> <rich-text nodes="{{nodes1}}" /> <rich-text nodes="{{nodes2}}" />
this.setData({ nodes: "