duxiaofeng-github 4 年之前
父節點
當前提交
5328b959f3
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21
    0
      docs/Guide.md

+ 21
- 0
docs/Guide.md 查看文件

@@ -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