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