index.vue 590 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
  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. console.log(option)
  20. this.url = option.url;
  21. try {
  22. const res = uni.getSystemInfoSync();
  23. this.windowW = res.windowWidth;
  24. this.windowH = res.windowHeight;
  25. } catch (e) {
  26. // error
  27. }
  28. }
  29. }
  30. </script>