Layui 的上传是最常用的, 不可或缺, 记录一下代码, 以后复制都能用!!
1.前端HTML:
修改头像
点击上传图片,或将图片拖拽到此处
2.前端js:
layui.use(["jquery", "upload", "form", "layer", "element"], function () {
var $ = layui.$,
element = layui.element,
layer = layui.layer,
upload = layui.upload,
form = layui.form;
//拖拽上传