是因为我们没用定义$
var $ = layui.$;
var data = obj.data;
var $ = layui.$;
//console.log(obj)
if (obj.event === 'del') {
layer.confirm('真的删除数据吗', function (index) {
obj.del();
console.log(data.id);
layer.close(index);
$.ajax({
url: 'url',
type:'post',
data:{},
success:function(data){
},
complete:function(){
}
})
});
}