Skip to content

Commit

Permalink
docs; navigateTo
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloudhdx committed Aug 26, 2020
1 parent c7604ba commit 69cc1af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/api/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ uni.navigateTo({
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
}
})
```
```
// 2.8.9+ 支持
// test.js
// uni.navigateTo 目标页面 pages/test.vue
onLoad: function(option) {
console.log(option.query)
const eventChannel = this.getOpenerEventChannel()
Expand All @@ -79,6 +76,7 @@ onLoad: function(option) {
}
```


url有长度限制,太长的字符串会传递失败,可使用[窗体通信](https://uniapp.dcloud.io/collocation/frame/communication)[全局变量](https://ask.dcloud.net.cn/article/35021),或`encodeURIComponent`等多种方式解决,如下为`encodeURIComponent`示例。
```html
<navigator :url="'/pages/test/test?item='+ encodeURIComponent(JSON.stringify(item))"></navigator>
Expand Down

0 comments on commit 69cc1af

Please sign in to comment.