duxiaofeng-github 4 anos atrás
pai
commit
5328b959f3
1 arquivos alterados com 21 adições e 0 exclusões
  1. 21
    0
      docs/Guide.md

+ 21
- 0
docs/Guide.md Ver arquivo

@@ -89,6 +89,27 @@ class MyWeb extends Component {
89 89
 }
90 90
 ```
91 91
 
92
+**Access local assets by WebViewAssetLoader on android x**
93
+
94
+Android x provide a new way to access assets, by using WebViewAssetLoader. now we can access assets via uri **https://appassets.androidplatform.net/assets/some-assets**
95
+
96
+For example:
97
+
98
+```tsx
99
+<WebView
100
+  ref={webViewRef}
101
+  originWhitelist={['*']}
102
+  source={{
103
+    uri: 'https://appassets.androidplatform.net/assets/index.html',
104
+  }}
105
+  onLoadEnd={sendRequests}
106
+  onMessage={(event) => {
107
+    console.log('resolve', event);
108
+    resolve(event.nativeEvent.data);
109
+  }}
110
+/>
111
+```
112
+
92 113
 </details>
93 114
 
94 115
 ### Controlling navigation state changes