需要初始化
var sanji='';
if(data.result=='success'){
for(var i=0;i<data.sanji.length;i++){
sanji+='<option value="'+data.sanji[i].id+'">'+data.sanji[i].nameZh+'</option>'
}
$("#sylysj_"+sortdiv).html(sanji);
syly_sj_html=sanji;
layui.use(['form'], function () {
var form = layui.form;
layui.form.render('select');
});
}
初始化的代码
layui.use(['form'], function () {
var form = layui.form;
layui.form.render('select');
});