Openinstall vue統合

1856 ワード



    export default {
       mounted:function(){
            const s = document.createElement('script');
            s.type = 'text/javascript';
            s.src = '//res.cdn.openinstall.io/openinstall.js';
            s.addEventListener('load',()=>{
              var data = OpenInstall.parseUrlParams();//openinstall.js        ,  url        
              new OpenInstall({
                  /*appKey    ,openinstall          ID*/
                  appKey : "3rqhu6",
                  /*    ,   android   apk     ;  andriod      ,         ,        !*/
                  //apkFileName : 'com.fm.openinstalldemo-v2.2.0.apk',
                  /*    ,        app,          */
                  //preferWakeup:true,
                  /*      html*/
                  //mask:function(){
                  //  return "<div id='openinstall_shadow' style='position:fixed;left:0;top:0;background:rgba(0,255,0,0.5);filter:alpha(opacity=50);width:100%;height:100%;z-index:10000;'></div>"
                  //},
                  /*openinstall          ,  */
                  onready : function() {
                      var m = this, button = document.getElementById("downloadButton");
                      button.style.visibility = "visible";

                      /* app          app*/
                      m.schemeWakeup();
                      /*         (    id downloadButton),  app*/
                      button.onclick = function() {
                          m.wakeupOrInstall();
                          return false;
                      }
                  }
              }, data);
            },false)
            document.head.appendChild(s);
       },
        methods:{

        }
    };