原文地址:https://fly.layui.com/jie/8420/
原文地址:https://fly.layui.com/jie/7573/
一:post方法上传
layui 2.1.0 标记下
before: function(obj){ layer.load(); //上传loading this.data={'xxx':'xxx'}; }
另一种方法
封装的函数如下: function extra_data(input,data){ var item=[]; $.each(data,function(k,v){ item.push('<input type="hidden" name="'+k+'" value="'+v+'">'); }) $(input).after(item.join('')); }
使用方法:
二:get
before: function (obj) { this.url = ApiUrl + '/api/XXX/UpLoadImage?StockId=' + stockId ; }