代码拉取完成,页面将自动刷新
layui.config({
base: './components/'
});
layui.use(["area","jquery"],function(){
var area = layui.area;
var $ = layui.jquery;
$("#sltBtn").click(function(){
area.select({
title:"请选择指定区域",
url:"components/area_data.json",
//selected:{countries:[],provinces:[],cities:[],counties:[]},//选中回显
//expSelected:{countries:[],provinces:[],cities:[],counties:[]},//需要排除已经选中的
level:3,//指定层级(1-省级、2-市级;3-区县)
selected:{countries:[],provinces:["150000","410000"],cities:["130100","430100"],counties:[]},//选中回显
expSelected:{countries:[],provinces:["110000"],cities:["220100"],counties:[]},//需要排除已经选中的
callback:function(rlt){
console.log(rlt);
$("#areaCodes").val(JSON.stringify(rlt.areaCodes));
$("#areaNames").val(rlt.areaNames);
}
});
});
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。