页面a:

 uni.navigateTo({
			url:"/pages/xx/index?id=1"
		})

页面b(接收)

<script>
	export default {
		data() {
			return {
				_id: ''
			}
		},
		onLoad(e) {
			this._id = e.id;
		}
	}
</script>
<script setup>
    import {
		ref,
		getCurrentInstance,
		onBeforeMount,
 	 } from 'vue'
    
    const id=ref('');
    onBeforeMount(()=>{
		id.value=getCurrentInstance().data._id;	
	})
</script>

查了下uniapp文档没有这方面描述,暂时可以使用这种混合取值方式,期待官方更新

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐