jq weui cityPickerを修正js元の値

765 ワード

1.バックグラウンドインタフェースを接続し、戻ってきた値を取得し、データフォーマットが同じであることに注意する
var raw;
$.ajax({
type: "GET",
url: "/web/region/list.json",
dataType: "json",
contentType: 'application/json;charset=utf-8',
success: function (data) {
var resData = data.data;
raw = resData
}
})

2. "map" , ajax ,
async: false
3. "map" , , c.sub , :
if(c.sub) {
c.sub.map(function (t) {
if (t.name === tokens[2]) d = t;
})
}

転載先:https://www.cnblogs.com/GGDong/p/10994294.html