index.vue 658 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}" />
  3. </template>
  4. <script>
  5. export default {
  6. data() {
  7. return {
  8. windowH: 0,
  9. windowW: 0,
  10. webviewStyles: {
  11. progress: {
  12. color: 'transparent'
  13. }
  14. },
  15. url: ''
  16. }
  17. },
  18. onLoad(option) {
  19. if (option.webUel) {
  20. this.url = option.webUel;
  21. }
  22. uni.setNavigationBarTitle({
  23. title: option.title
  24. })
  25. try {
  26. const res = uni.getSystemInfoSync();
  27. this.windowW = res.windowWidth;
  28. this.windowH = res.windowHeight;
  29. } catch (e) {
  30. // error
  31. }
  32. }
  33. }
  34. </script>