阅读量:0
A页面 发送值
<script setup> import { ref } from 'vue' const shuruzhi = ref() function duohangzhi(res) { shuruzhi.value = res.detail.value console.log("输入的值", shuruzhi.value) } function shengcheng() { uni.navigateTo({ url: '/pages/index/erweimaxiangqing?value=' + shuruzhi.value }); } </script>
B页面接受值
<script setup> import { ref, onMounted } from 'vue' import { onLoad } from '@dcloudio/uni-app'; onLoad((options) => { console.log('接收传值:', options.value); zhi.value = options.value// 这里的options.query包含了通过URL传递的参数 }); const zhi = ref('') </script>