子页面iframe如何调用 父页面的方法 或者对象(基于layui框架)

layui.use(... function(){
var _tools = {
func1: function(){
console.log('func1');
}
}
window.tools = _tools;
})


// 外部调用,如子页面
parent.tools.func1();

猜你喜欢

转载自www.cnblogs.com/Angel-szl/p/11232485.html