123456789101112131415161718192021222324252627282930 |
- <template>
- <view>
- <web-view :src="href"></web-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- href:'页面丢失。'
- };
- },
- onLoad: function(option) {
- var _self = this
- const eventChannel = this.getOpenerEventChannel()
- // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
- eventChannel.on('acceptDataFromOpenerPage', function(data) {
- // console.log(data.href)
- _self.href = data.href
- // console.log(this.href)
- })
- console.log(this.href)
- }
- }
- </script>
- <style lang="scss">
-
- </style>
|