原文地址: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 ; }