异步获取api数据并渲染layui.table
$.ajax({
//请求数据格式见:https://www.layui.com/doc/modules/tree.html
url: "{:url('content.Category/menu')}",
type: 'GET',
success: function (dataList) {
//点击节点新窗口跳转
tree.render({
elem: '#categoryMenuTree',
data: dataList,
isJump: true, //link 为参数匹配
//利用回调 使url在name为articleIframe的iframe中显示
click: function (layero, index) {
//console.log(layero.data.href);
myhref = {"ew-href" : layero.data.href};
$(".layui-tree-txt").attr(myhref).removeAttr("href");
}
});
}
});
//利用回调 使url
在name
为articleIframe
的iframe
中显示
click: function (layero, index) {
//console.log(layero.data.href);
myhref = {"ew-href" : layero.data.href};
$(".layui-tree-txt").attr(myhref).removeAttr("href");
}
重点我记的是这里
myhref = {"ew-href" : layero.data.href};
$(".layui-tree-txt").attr(myhref).removeAttr("href");
动态修改表单属性并赋值
1