提交 b2209bad 编写于 作者: W wanganxp

x

上级 78a70b44
......@@ -91,6 +91,7 @@
* [web-view组件上下文对象](api/create-webview-context.md)
* [video组件上下文对象](api/create-video-context.md)
* [uniCloud客户端API](unicloud.md)
* [其他EXT API](ext.md)
* CSS
* [CSS概述](css/README.md)
* [align-content](css/align-content.md)
......
......@@ -54,6 +54,9 @@
<!-- UTSAPIJSON.switchTab.tutorial -->
### bug&tips
- 首页不是tabbar的情况,暂不支持switchTab
## uni.navigateBack(options?) @navigateback
<!-- UTSAPIJSON.navigateBack.description -->
......
......@@ -28,6 +28,6 @@ ijkplayer库的功能较多,video组件并非完全封装。有需要的开发
### 上下文对象API
video的操作api为[uni.createVideoContext()](../api/createvideocontext.md)
video的操作api为[uni.createVideoContext()](../api/create-video-context.md)
给video组件设一个id属性,将id的值传入uni.createVideoContext(),即可得到video组件的上下文对象,进一步可使用`.play()``.stop()`等方法。
......@@ -16,6 +16,38 @@
### 上下文对象API
web-view的操作api为[uni.createWebviewContext()](../api/createwebviewcontext.md)
web-view的操作api为[uni.createWebviewContext()](../api/create-webview-context.md)
给web-view组件设一个id属性,将id的值传入uni.createWebviewContext(),即可得到web-view组件的上下文对象,进一步可使用`.evalJS()``.reload()`等方法。
### web-view组件的内外通信
- uts向web-view的网页发消息
使用`evalJS()`方法,详见上方示例代码
- web-view里的网页向uts发消息
在网页中引入[uni.webview.1.5.5.js](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/hybrid/html/uni.webview.1.5.5.js)。即可在网页中调用一批uni的api,包括:
|方法名|说明|平台差异说明|
|:-|:-|:-|
|uni.navigateTo|[navigateTo](../api/navigator.md#uni.navigateto)||
|uni.redirectTo|[redirectTo](../api/navigator#redirectto)||
|uni.reLaunch|[reLaunch](../api/navigator#relaunch)||
|uni.switchTab|[switchTab](../api/navigator#switchtab)||
|uni.navigateBack|[navigateBack](../api/navigator#navigateback)||
|uni.postMessage|向应用发送消息||
在网页中使用`uni.postMessage()`即可向uts发送消息。
uts端在 `<web-view>` 组件的 `message` 事件回调 `event.detail.data` 中接收消息。
示例代码详见[hello-uni-app-x/hybrid/html/local.html](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/hybrid/html/local.html)
**Tips**
- 传递的消息信息,必须写在 data 对象中。
- `event.detail.data` 中的数据,以数组的形式接收每次 post 的消息。(注:支付宝小程序除外,支付宝小程序中以对象形式接受)
## 注意
- web-view组件为系统web-view,内核版本号不由uni-app x框架控制。如需x5等webview,需另行开发插件。
\ No newline at end of file
# ext api
基于uts实现的、以插件方式存在的、uni-app和uni-app x均兼容支持的api,还有一批:
- [wifi](https://uniapp.dcloud.net.cn/api/system/wifi.html)
- 监听内存告警:[uni.onMemoryWarning、uni.offMemoryWarning](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)
- 监听截屏和设置是否允许截屏[uni.onUserCaptureScreen、uni.offUserCaptureScreen、uni.setUserCaptureScreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#setusercapturescreen)
- [uni实人认证](https://uniapp.dcloud.net.cn/uniCloud/frv/dev.html)
插件市场还有一批可替代uni内置api的插件,比如在插件市场搜索:
- [剪切板](https://ext.dcloud.net.cn/search?q=%E5%89%AA%E5%88%87%E6%9D%BF&orderBy=Relevance&cat1=8&cat2=81)
- [蓝牙](https://ext.dcloud.net.cn/search?q=%E8%93%9D%E7%89%99&orderBy=Relevance&cat1=8&cat2=81)
- [nfc](https://ext.dcloud.net.cn/search?q=nfc&orderBy=Relevance&cat1=8&cat2=81)
- [文件选择](https://ext.dcloud.net.cn/search?q=%E6%96%87%E4%BB%B6%E9%80%89%E6%8B%A9&cat1=8&cat2=81)
\ No newline at end of file
......@@ -3,6 +3,8 @@
截止到目前,uni-app x下的uniCloud还不支持:
- 由于uts暂不支持await,目前仅能通过promise方式使用异步联网api。
- 暂不支持clientDB组件
- 暂不支持schema2code
- 暂不支持安全网络
- 暂不支持泛型
- 暂不支持pages.json中的uniIdRouter
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册