index.vue 727 B

12345678910111213141516171819202122232425262728293031323334353637
  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. import {
  6. mapGetters
  7. } from "vuex";
  8. export default {
  9. //computed: mapGetters(['chatUrl']),
  10. data() {
  11. return {
  12. windowH: 0,
  13. windowW: 0,
  14. webviewStyles: {
  15. progress: {
  16. color: 'transparent'
  17. }
  18. },
  19. url: ''
  20. }
  21. },
  22. onLoad(option) {
  23. if(option.webUel) this.url = option.webUel;
  24. uni.setNavigationBarTitle({
  25. title: option.title
  26. })
  27. try {
  28. const res = uni.getSystemInfoSync();
  29. this.windowW = res.windowWidth;
  30. this.windowH = res.windowHeight;
  31. } catch (e) {
  32. // error
  33. }
  34. }
  35. }
  36. </script>