通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
css ``` .uploadimg { width:200px; height:120px; margin: 5px; border-radius: 3px; background: lightblue; text-align: center; font-weight: 400; font-size: 15px; color:#fff } .uploadimg:after { content:"请上传文件"; line-height: 120px; } ``` html ``` <img src="/static/image/uploadimg.png" class="uploadimg" id="ceo_img" alt=""> ``` js ``` layui.use(['jquery', 'upload'], function () { $ = layui.jquery; //执行实例 var uploadInst = layui.upload.render({ elem: '.uploadimg', url: "{:url('api/common/upload')}", //上传接口 done: function (res) { // 给此img设置src属性 $(this.item).attr('src', res.data.src); }, error: function () { layer.msg('上传文件失败'); } }); }); ``` > 获取图片地址 `$('#ceo_img').attr('src');`