我正在使用react-native
应用程序,在其中使用pdf, doc/docx, xls,/xlsx
在应用程序内显示上载文档(react-native-webview
),如下所示,
<WebView
source={{ uri: 'DOCUMENT_LINK' }}
onLoadStart={syntheticEvent => {
// update component to be aware of loading status
const { nativeEvent } = syntheticEvent;
console.log('LStart :' + JSON.stringify(nativeEvent));
}
}
onLoadEnd={syntheticEvent => {
// update component to be aware of loading status
const { nativeEvent } = syntheticEvent;
console.log('LEnd:' + JSON.stringify(nativeEvent));
}}
/>
现在这里有时是从URL加载文档,但有时会引发错误(10次中有2次),如下所示:
LStart :{"canGoForward":false,"canGoBack":false,"title":"about:blank","loading":true,"url":"about:blank","target":3265}
LEnd :{"canGoForward":false,"canGoBack":false,"title":"about:blank","loading":false,"url":"about:blank","target":3265}
我不知道这是怎么回事。任何人都可以有任何想法。