mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改插件案例
This commit is contained in:
parent
dfd42dbeb3
commit
1803fdae47
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
{block name="content"}
|
{block name="content"}
|
||||||
|
|
||||||
<div class="code">
|
|
||||||
<style>
|
<style>
|
||||||
.uploadbutton {
|
.uploadbutton {
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
@ -13,10 +12,10 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<div class="code">
|
||||||
<blockquote class="site-text layui-elem-quote">
|
<blockquote class="site-text layui-elem-quote">
|
||||||
单图片上传
|
单图片上传
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<div style="position:relative">
|
<div style="position:relative">
|
||||||
<div class="uploadimage">
|
<div class="uploadimage">
|
||||||
<input type="hidden" name="file_1"/>
|
<input type="hidden" name="file_1"/>
|
||||||
@ -28,7 +27,6 @@
|
|||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
class="uploadbutton">上传图片</a>
|
class="uploadbutton">上传图片</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
require(['jquery'], function () {
|
require(['jquery'], function () {
|
||||||
$('[name="file_1"]').on('change', function () {
|
$('[name="file_1"]').on('change', function () {
|
||||||
@ -37,7 +35,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<pre class="layui-code" lay-title="HTML代码">
|
<pre class="layui-code" lay-title="HTML代码">
|
||||||
|
|
||||||
<div style="position:relative">
|
<div style="position:relative">
|
||||||
@ -62,11 +59,56 @@ require(['jquery'], function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</pre>
|
</pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="code">
|
||||||
|
<blockquote class="site-text layui-elem-quote">
|
||||||
|
单文件上传
|
||||||
|
</blockquote>
|
||||||
|
<div style="position:relative">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" name="file_2" placeholder="请选择文件...">
|
||||||
|
<a class="input-group-addon"
|
||||||
|
data-file="one"
|
||||||
|
data-type="zip"
|
||||||
|
data-uptype="local"
|
||||||
|
data-field="file_2">
|
||||||
|
<i class="fa fa-file"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
require(['pcasunzips'], function () {
|
require(['jquery'], function () {
|
||||||
new PCAS('province', 'city', 'area', '广东省', '广州市', '海珠区');
|
$('[name="file_1"]').on('change', function () {
|
||||||
|
$(this).parent().css('backgroundImage', 'url(' + this.value + ')');
|
||||||
|
$(this).parent().attr('data-tips-image', this.value);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<pre class="layui-code" lay-title="HTML代码">
|
||||||
|
|
||||||
|
<div style="position:relative">
|
||||||
|
<div class="uploadimage">
|
||||||
|
<input type="hidden" name="file_1"/>
|
||||||
|
</div>
|
||||||
|
<a data-file="one"
|
||||||
|
data-field="file_1"
|
||||||
|
data-type="png,jpg"
|
||||||
|
data-uptype="local"
|
||||||
|
href="javascript:void(0)">上传图片</a>
|
||||||
|
</div>
|
||||||
|
</pre>
|
||||||
|
<pre class="layui-code" lay-title="javascript代码">
|
||||||
|
|
||||||
|
// 监听 input 的 onchange 事件
|
||||||
|
// 当有图片上传时,会触发 change 事件
|
||||||
|
require(['jquery'], function () {
|
||||||
|
$('[name="file_1"]').on('change', function () {
|
||||||
|
$(this).parent().css('backgroundImage', 'url(' + this.value + ')');
|
||||||
|
$(this).parent().attr('data-tips-image', this.value);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
// | github开源项目:https://github.com/zoujingli/Think.Admin
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
return [];
|
|
||||||
/* 测试环境禁止操作路由绑定 */
|
/* 测试环境禁止操作路由绑定 */
|
||||||
think\Route::post([
|
think\Route::post([
|
||||||
// 禁止修改用户资料
|
// 禁止修改用户资料
|
||||||
|
Loading…
x
Reference in New Issue
Block a user