66 lines
1.4 KiB
HTML
66 lines
1.4 KiB
HTML
{% load static %}
|
|
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>upload模块快速使用</title>
|
|
<link rel="stylesheet" href="/static/css/layui.css" media="all">
|
|
</head>
|
|
<body>
|
|
|
|
<button type="button" class="layui-btn" id="test1">
|
|
<i class="layui-icon"></i>上传文件
|
|
</button>
|
|
|
|
|
|
<li class="layui-nav-item">
|
|
<a href="javascript:">text</a>
|
|
<dl class="layui-nav-child">
|
|
|
|
<dd style="overflow: hidden">
|
|
<div class="color">
|
|
<label class="label_meg">size </label>
|
|
<div class="layui-input-inline" style="float: right">
|
|
<input type="text" id="title_size" lay-verify="required" value="12"
|
|
autocomplete="off" class="layui-input"
|
|
style="height: 25px; width:90px;margin-top: 6px">
|
|
</div>
|
|
</div>
|
|
</dd>
|
|
|
|
</dl>
|
|
</li>
|
|
|
|
|
|
<script src="/static/layui.js"></script>
|
|
<script>
|
|
layui.use('upload', function () {
|
|
var upload = layui.upload;
|
|
|
|
//执行实例
|
|
var uploadInst = upload.render({
|
|
elem: '#test1' //绑定元素
|
|
, url: '/upload/' //上传接口,accept: 'file'
|
|
, accept: 'file'
|
|
, data: {}
|
|
|
|
, done: function (res) {
|
|
|
|
//上传完毕回调
|
|
}
|
|
, error: function () {
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|