bigdata.vue 784 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div class="pageDetail">
  3. <yx-navbar :isBack="true" :title="title"></yx-navbar>
  4. <iframe class="iframe" id="iframe" :src="src" frameborder="0"></iframe>
  5. </div>
  6. </template>
  7. <script>
  8. import Cookies from 'js-cookie'
  9. export default {
  10. data() {
  11. return {
  12. title: '详情',
  13. src: window._CONFIG.APP_READY + '#/newbi/h5',
  14. id: ''
  15. }
  16. },
  17. onLoad(options) {
  18. this.title = options.title
  19. this.id = options.id
  20. },
  21. mounted() {
  22. let iframe = document.getElementById('iframe')
  23. console.log('mounted')
  24. iframe.onload = () => {
  25. console.log('onload')
  26. let token = Cookies.get('congress')
  27. iframe.contentWindow.postMessage({token: token, id: this.id}, '*')
  28. console.log('sent')
  29. }
  30. },
  31. }
  32. </script>
  33. <style>
  34. </style>