webview.vue 857 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <!-- <view class="dt-page"> -->
  3. <web-view :src="url" @onPostMessage="onPostMessage"></web-view>
  4. <!-- <DtEmpty :type="emptyType" /> -->
  5. <!-- </view> -->
  6. </template>
  7. <script>
  8. export default {
  9. data(){
  10. return {
  11. url:''
  12. }
  13. },
  14. onLoad(options){
  15. this.url = options.url;
  16. // if(options.url){
  17. // this.url = decodeURIComponent(options.url)
  18. // this.url = 'http://app.91syzl.com/special/store/branch/10001/hepatic1/74/';
  19. // this.emptyType = 0
  20. // }else{
  21. // this.emptyType = 1
  22. // }
  23. },
  24. methods:{
  25. message(e){
  26. console.log('接收到的特定时机(后退、组件销毁、分享)消息:' + JSON.stringify(e.detail.data));
  27. },
  28. onPostMessage(e){
  29. console.log(e)
  30. console.log('接收到的实时消息:' + JSON.stringify(e.detail.data));
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. </style>