You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webView.vue 953B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <!-- <cover-view class="custom-nav" @click="closeWebView">
  3. <cover-image class="close-icon" src="/static/image/icon-back.png" ></cover-image>
  4. <cover-view>返回</cover-view>
  5. </cover-view> -->
  6. <web-view :src="state.url"></web-view>
  7. </template>
  8. <script setup>
  9. import {onLoad} from "@dcloudio/uni-app";
  10. import {reactive} from "vue";
  11. const state = reactive({
  12. url:"",
  13. visitCount:0
  14. })
  15. onLoad((option) => {
  16. console.log("option",option)
  17. state.url=option.url
  18. state.visitCount++
  19. });
  20. const closeWebView=()=>{
  21. uni.navigateBack({
  22. delta:state.visitCount
  23. })
  24. }
  25. </script>
  26. <style scoped>
  27. .custom-nav {
  28. position: fixed;
  29. top: 0;
  30. width: 100%;
  31. height: 44px;
  32. background-color: #fff;
  33. display: flex;
  34. justify-content: flex-start;
  35. align-items: center;
  36. z-index: 999;
  37. box-sizing: border-box;
  38. padding: 0 10rpx;
  39. }
  40. .close-icon{
  41. width: 30rpx;
  42. height: 30rpx;
  43. transform:rotateX(180deg);
  44. }
  45. </style>