提交 a47b0c87 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

update(eventChannel): 更新全端通过this.getOpenerEventChannel()获取

上级 a488056c
......@@ -65,12 +65,7 @@ uni.navigateTo({
// 在test.vue页面,向起始页通过事件传递数据
onLoad: function(option) {
// #ifdef APP-NVUE
const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
// #endif
// #ifndef APP-NVUE
const eventChannel = this.getOpenerEventChannel();
// #endif
eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'});
eventChannel.emit('someEvent', {data: 'data from test page for someEvent'});
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
......@@ -96,7 +91,6 @@ onLoad: function (option) {
* 页面跳转路径有层级限制,不能无限制跳转新页面
* 跳转到 tabBar 页面只能使用 switchTab 跳转
* 路由API的目标页面必须是在pages.json里注册的vue页面。如果想打开web url,在App平台可以使用 [plus.runtime.openURL](http://www.html5plus.org/doc/zh_cn/runtime.html#plus.runtime.openURL)或web-view组件;H5平台使用 window.open;小程序平台使用web-view组件(url需在小程序的联网白名单中)。在hello uni-app中有个组件ulink.vue已对多端进行封装,可参考。
* APP-NVUE平台 vue2 暂不支持以`this.getOpenerEventChannel()`方式获取`eventChannel`,请换用`this.$scope.eventChannel`来获取,具体方式请参考上述示例。
### uni.redirectTo(OBJECT)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册