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的变量名

然后就可以愉快的玩耍了

!!!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM