打開新窗口
在控件上添加 lay-href 屬性,並傳遞參數:url地址 tit標題
<a lay-text="新窗口" onclick="newTab('xxx.html,'打開新窗口')" >
打開新窗口方法:
function newTab(url, title) {
if (top.layui.index) {
top.layui.index.openTabsPage(url, title);
} else {
window.open(url);
}