Gcanvas-For-Apache-weex icon indicating copy to clipboard operation
Gcanvas-For-Apache-weex copied to clipboard

pc机浏览器中无法运行

Open ellisez opened this issue 7 years ago • 0 comments

追踪代码如下:

js/src/gcanvas.js中: GCanvas的start函数=》

start: function (el, succ, fail) { GLog.d('gcanvas#start=====>>>');

    //get device
    **GBridge.getDeviceInfo(function(e){**//这里是异步操作

      if (e.data && e.data.platform == "iOS"){
          GCanvasPlatform = 1;
      ......
      }
  })

}

GBridge.getDeviceInfo( function(){ .... } )

在js/src/gutil.js中,getDeviceInfo函数

getDeviceInfo: function (callback) { if (!inWeex) { return; }

因为在pc浏览器中inWeex永为false,所以直接return短路,没有进入callback 导致pc机浏览器空白了,后续没有渲染

ellisez avatar Dec 24 '17 18:12 ellisez