i-block-detail.vue 623 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <view>
  3. <web-view :src="href"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. href:'页面丢失。'
  11. };
  12. },
  13. onLoad: function(option) {
  14. var _self = this
  15. const eventChannel = this.getOpenerEventChannel()
  16. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  17. eventChannel.on('acceptDataFromOpenerPage', function(data) {
  18. // console.log(data.href)
  19. _self.href = data.href
  20. // console.log(this.href)
  21. })
  22. console.log(this.href)
  23. }
  24. }
  25. </script>
  26. <style lang="scss">
  27. </style>