webview.vue 549 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="webview-container">
  3. <web-view class="webview" :src="url" @bindmessage="message"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. components: {},
  9. data() {
  10. return {
  11. url: ''
  12. }
  13. },
  14. onLoad(options) {
  15. this.url = decodeURIComponent(options.url)
  16. console.log(options.url)
  17. },
  18. methods: {
  19. message(e,h,z) {
  20. console.log(e,h,z)
  21. }
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. .webview-container {
  27. display: flex;
  28. flex-direction: column;
  29. }
  30. .webview {
  31. flex: 1;
  32. }
  33. </style>