Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

pc机浏览器中无法运行 #40

Open
ellisez opened this issue Dec 24, 2017 · 0 comments
Open

pc机浏览器中无法运行 #40

ellisez opened this issue Dec 24, 2017 · 0 comments

Comments

@ellisez
Copy link

ellisez commented Dec 24, 2017

追踪代码如下:

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机浏览器空白了,后续没有渲染

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant