index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // +----------------------------------------------------------------------
  6. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  7. // +----------------------------------------------------------------------
  8. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  9. // +----------------------------------------------------------------------
  10. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  11. // +----------------------------------------------------------------------
  12. // | Author: CRMEB Team <admin@crmeb.com>
  13. // +----------------------------------------------------------------------
  14. export default {
  15. data() {
  16. return {
  17. windowH: 0,
  18. windowW: 0,
  19. webviewStyles: {
  20. progress: {
  21. color: 'transparent'
  22. }
  23. },
  24. url: ''
  25. }
  26. },
  27. onLoad(option) {
  28. this.url = decodeURIComponent(option.url);
  29. try {
  30. const res = uni.getSystemInfoSync();
  31. this.windowW = res.windowWidth;
  32. this.windowH = res.windowHeight;
  33. } catch (e) {
  34. // error
  35. }
  36. }
  37. }
  38. </script>