index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view v-if="url">
  3. <view style="min-height: 100vh;overflow-y: auto;display: flex;flex-direction: column;">
  4. <view style="flex: 0 0 auto;" >1235</view>
  5. <view style="height: 100vh;position: relative;"><web-view :webview-styles="webviewStyles" :src="`${url}`"></web-view></view>
  6. <view style="height: 400rpx;background-color: #000;color: #000;flex: 0 0 auto;">1235</view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. params: {},
  15. url:'',
  16. webviewStyles: {
  17. progress: {
  18. color: "#FF3333",
  19. height:'400rpx'
  20. }
  21. }
  22. }
  23. },
  24. props: {
  25. src: {
  26. type: [String],
  27. default: null
  28. }
  29. },
  30. onLoad(e) {
  31. this.url=decodeURIComponent(e.url);
  32. uni.showLoading({
  33. title: '加载中'
  34. });
  35. setTimeout(function(){
  36. uni.hideLoading()
  37. },1500)
  38. if(e.title){
  39. uni.setNavigationBarTitle({
  40. title: e.title
  41. });
  42. // #ifdef H5
  43. document.title = e.title;
  44. // #endif
  45. }
  46. }
  47. }
  48. </script>