Vue SPA应用中使用Layer的iframe 弹出层,并且传值

问题来源: BOOS 竟然说喜欢有可移动可最大化的弹出层,这!!!

 SPA 模式下就是这种引入Vue.js的写法

layer.open({
           type: 2,
           area: ['840px', '550px'],
           fixed: false, //不固定
           maxmin: true,
           title:title,
           content:url,
       });

正常引入layui.js  然后弹出,然后弹出层要调用父级层的方法,和赋值

     var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

                    parent.app.UserCheckCount=this.UserCheckCount;
                    parent.app.UserCheckList=this.UserCheckList;
                    parent.app.QuestionSelectList=this.QuestionSelectList;


                    parent.app.FatherQuestionList=this.QuestionSelectList;
                    parent.app.FatherQuestionMake();

                    console.log(parent.app.QuestionList);
                    parent.app.QuestionSelectKey=this.QuestionSelectKey;
                    parent.app.QuesctionPageMake();

                    parent.layer.close(index);

注意app是父级new 出来Vue的变量名

然后就可以愉快的玩耍了

!!!

猜你喜欢

转载自www.cnblogs.com/wlphp/p/10542386.html