reportPage.vue 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="pageContainer">
  3. <web-view v-if="url" :webview-styles="webviewStyles"
  4. class="web-view"
  5. :src="url"></web-view>
  6. </view>
  7. </template>
  8. <script>
  9. var wv;//计划创建的webview
  10. export default {
  11. data() {
  12. return {
  13. webviewStyles: {
  14. progress: {
  15. color: '#FF3333'
  16. }
  17. },
  18. url:''
  19. };
  20. },
  21. onReady() {
  22. // // #ifdef APP-PLUS
  23. // var currentWebview = this.$scope
  24. // .$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
  25. // setTimeout(function() {
  26. // wv = currentWebview.children()[0]
  27. // wv.setStyle({
  28. // top: 150,
  29. // height: 300
  30. // })
  31. // }, 1000); //如果是页面初始化调用时,需要延时一下
  32. // // #endif
  33. },
  34. onLoad({url}) {
  35. this.url = url
  36. }
  37. }
  38. </script>
  39. <style lang="less">
  40. .pageContainer {
  41. overflow: scroll;
  42. }
  43. </style>