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

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

 

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

然后就可以愉快的玩耍了

!!!

 

相关文章:

  • 2022-12-23
  • 2021-07-28
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-08-20
猜你喜欢
  • 2021-05-22
  • 2021-12-07
  • 2021-07-29
  • 2022-12-23
  • 2021-11-16
相关资源
相似解决方案