const id = ref('');
async function getMemberInfo(){
console.log(id.value)
}
onLoad((options) => {
id.value = options.id || ''
console.log(id.value)
getMemberInfo()
})
这段代码getMemberInfo函数中打印id.value报错ReferenceError: Cannot access 'id' before initialization,在onLoad中没问题,什么原因

c55 (作者)
我改为onMounted,我怎么获取传递过来的参数,我进来就定义了id,调用getMemberInfo还在我初始化id之后,为啥不行
2025-12-25 16:41