index.vue 645 B

12345678910111213141516171819202122232425262728293031323334
  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. this.url = this.chatUrl;
  24. try {
  25. const res = uni.getSystemInfoSync();
  26. this.windowW = res.windowWidth;
  27. this.windowH = res.windowHeight;
  28. } catch (e) {
  29. // error
  30. }
  31. }
  32. }
  33. </script>