layui/docs/upload/detail/demo.md

62 lines
1.9 KiB
Markdown
Raw Normal View History

2023-04-24 00:42:47 +00:00
<h3 lay-toc="{level: 2, id: 'examples', hot: true}" class="layui-hide">图片上传</h3>
<pre class="layui-code" lay-options="{preview: true, codeStyle: 'height: 535px;', text: {preview: ''}, layout: ['preview', 'code'], tools: ['full'], done: function(obj){
obj.render();
}}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/image.md") }}
2023-04-24 00:42:47 +00:00
</script>
</textarea>
</pre>
<h3 id="demo-files-table" lay-toc="{level: 2}">制作多文件上传表格</h3>
<pre class="layui-code" lay-options="{preview: true, codeStyle: 'height: 535px;', layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/files.table.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>
<h3 id="demo-accept" lay-toc="{level: 2}">过滤文件类型</h3>
<pre class="layui-code" lay-options="{preview: true, codeStyle: 'height: 535px;', layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/accept.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>
<h3 id="demo-size" lay-toc="{level: 2}">限制文件大小</h3>
<pre class="layui-code" lay-options="{preview: true, layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/size.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>
<h3 id="demo-auto" lay-toc="{level: 2}">选择后手动上传</h3>
<pre class="layui-code" lay-options="{preview: true, layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/auto.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>
<h3 id="demo-drag" lay-toc="{level: 2}">拖拽上传</h3>
<pre class="layui-code" lay-options="{preview: true, layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/drag.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>
<h3 id="demo-form-file" lay-toc="{level: 2}">绑定原始文件域</h3>
<pre class="layui-code" lay-options="{preview: true, layout: ['preview', 'code'], tools: ['full']}">
<textarea>
2023-05-10 04:14:45 +00:00
{{- d.include("/upload/examples/form.file.md") }}
2023-04-24 00:42:47 +00:00
</textarea>
</pre>