00015-layui 的页签tabs切换,刷新页签的内容
<div class="layui-card-body" style="padding:0;">
<div class="layui-tab layui-tab-card" style="margin:0" lay-filter="myTaskTabs">
<ul class="layui-tab-title">
<li class="layui-this">待处理</li>
<li>我创建</li>
<li>已完成</li>
<li>全部</li>
</ul>
<div class="layui-tab-content" style="padding:0px;">
<div class="layui-tab-item layui-show">
<iframe src="myTaskTodoList.jsp" style="width:100%;height:94%;" frameborder="0" name="iframe0" ></iframe>
</div>
<div class="layui-tab-item">
<iframe src="myCreateTaskList.jsp" style="width:100%;height:94%;" frameborder="0" name="iframe1" ></iframe>
</div>
<div class="layui-tab-item">
<iframe src="myTaskDoneList.jsp" style="width:100%;height:94%;" frameborder="0" name="iframe2" ></iframe>
</div>
<div class="layui-tab-item">
<iframe src="myTaskList.jsp" style="width:100%;height:94%;" frameborder="0" name="iframe3" ></iframe>
</div>
</div>
</div>
</div>
<script> layui.config({ base: ‘${ctxLayui}/layuiadmin/‘ }).extend({ index: ‘lib/index‘ }).use([‘index‘, ‘table‘,‘dict‘,‘laydate‘,‘util‘,‘element‘], function(){ var $ = layui.$,table = layui.table,form = layui.form; var dict = layui.dict; var laydate = layui.laydate; var admin = layui.admin; var util = layui.util; var element = layui.element; element.on(‘tab(myTaskTabs)‘,function (data) { var index = data.index; var urlArr = [ ‘myTaskTodoList.jsp‘, ‘myCreateTaskList.jsp‘, ‘myTaskDoneList.jsp‘, ‘myTaskList.jsp‘, ]; layui.$("iframe[name=‘iframe" + index + "‘]").attr("src",urlArr[index]); }) }); </script>
即动态修改 iframe 的src ,页面会重新加载。
相关推荐
yogoma 2020-05-30
82550495 2013-05-10
smj000 2019-12-18
HotStrong 2014-07-07
84403067 2015-02-12
那年夏天 2019-06-29
ruoyiqing 2016-04-06
芯果科技蔡彦 2015-10-16
wustrive00 2015-02-12
XHQT0 2014-09-26
suis 2014-09-26
UC浏览器搜索引擎 2019-06-26
hackcat 2013-05-10
81751330 2013-04-24
lining 2012-12-31
87281248 2012-12-28
钱多多 2012-12-24
李守彬的空间 2019-06-21