| | |
| | | <!-- 已执行 --> |
| | | <template> |
| | | <view> 基础 </view> |
| | | <web-view ref="sWebViewRef" :src="`${viewUrl}`" @message="onPostMessage" @onPostMessage="onPostMessage" /> |
| | | </template> |
| | | |
| | | <script setup></script> |
| | | <script setup> |
| | | import {onLoad} from "@dcloudio/uni-app"; |
| | | import {useUserStore} from "@/store/index.js"; |
| | | |
| | | const sWebViewRef = ref(null); |
| | | const userStore = useUserStore(); |
| | | let viewUrl = '' |
| | | |
| | | function onPostMessage(event) { |
| | | if (event.detail.data[0].type === 'back') { |
| | | // active.value = null |
| | | } |
| | | } |
| | | |
| | | // onLoad(() => { |
| | | // window.addEventListener('message', function (e) { |
| | | // if (e.data.data.type === 'back') { |
| | | // // active.value = null |
| | | // } |
| | | // }); |
| | | // }) |
| | | |
| | | onLoad((options) => { |
| | | // console.log('options1111111', JSON.parse(decodeURIComponent(options))); |
| | | const id=3333 |
| | | viewUrl = `http://192.168.1.178:5173/drone-app-web-view/#/webViewWrapper/execution?rowItem=${id}`; |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |