mui 的选择器案例,二级联动,数据存在 city.js
省——1000
children:
市1——1001
市2——1002
市3——1003
市4——1004
市5——1005
怎么通过 1004 获取 市4,
即 通过 value 获取 text
附:
一级选择器,修改 mui.picker.js
Picker.prototype.getSelectedText = function(value) {
var self = this;
for (var index in self.items) {
var item = self.items[index];
if (item.value == value) {
return (self.items[index] || {}).text;
}
}
};
web 调用
userPicker.pickers[0].getSelectedText( value值 )
0 个回复