示例1.
layer.open({
type: 0,
skin: "layui-layer-molv",
title: "信息",
content: data.code == 1 ? "添加成功!" : "添加失败!",
btn: ['返回列表'],
yes: function () {
let index = parent.layer.getFrameIndex(window.name);
parent.layui.table.reload('news_table');//重载父页表格,参数为表格ID
parent.layer.close(index);
}
});
推荐示例2.
layer.open({
type: 0,
skin: "layui-layer-molv",
title: "信息",
content: data.code == 1 ? "添加成功!" : "添加失败!",
btn: ['返回列表'],
yes: function () {
parent.layui.closeAll();
parent.layui.table.reload('news_table');//重载父页表格,参数为表格ID
}
});