webview.vue 775 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view>
  3. <view>
  4. <!-- <web-view :webview-styles="webviewStyles" src="https://uniapp.dcloud.io/static/web-view.html" @message='getMessage'></web-view> -->
  5. <web-view :webview-styles="webviewStyles" :src="url" @message='getMessage'></web-view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { BASEURL } from '../../API/Constant.js' ;
  11. export default {
  12. data() {
  13. return {
  14. path:'product/manual',
  15. webviewStyles: {
  16. progress: {
  17. color: '#FF3333'
  18. }
  19. }
  20. }
  21. },
  22. methods: {
  23. getMessage(event){
  24. console.log(event);
  25. }
  26. },
  27. computed:{
  28. url(){
  29. return `${BASEURL}${this.path}`
  30. }
  31. },
  32. onLoad(option){
  33. if(option.path && option.path.length > 0){
  34. this.path = option.path
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. </style>