demo.vue 686 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!--扫描二维码页面-->
  2. <template>
  3. <view id="demo-view-page">
  4. <web-view @message="handleMessage"
  5. :src="'http://192.168.1.10/#/miniProgramAuthentication?token='+'11112222'">
  6. </web-view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "demo",
  12. data() {
  13. return {
  14. }
  15. },
  16. onLoad(option) {
  17. },
  18. mounted() {
  19. },
  20. methods: {
  21. handleMessage(e) {
  22. console.log('e>>>>>', e);
  23. const receivedData = e.detail.data; // 接收到的数据
  24. console.log('收到H5消息:', receivedData);
  25. // 处理数据逻辑...
  26. }
  27. },
  28. }
  29. </script>
  30. <style lang="stylus" scoped>
  31. #demo-view-page {
  32. width:100%;
  33. height:100%;
  34. overflow:scroll;
  35. }
  36. </style>