uniapp 后一页传值到前一页

前端 · 01-23

场景表单选择客户

// 页面1 
onShow() {
    uni.$on('selectedCustomer', (data) => {
        console.log(data)
    })
},
// 页面2 
    uni.$emit('selectedCustomer', {id:1,name:'张三'})
    uni.navigateBack({
    delta: 1
    })
uniapp
Theme Jasmine by Kent Liao