huilderx 版本
list
javascript
function getId(data) {
// console.log('接收到的参数', data)
if (data) {
buildObj.value = JSON.parse(data);
}
}
onShow((options) => {
getBuild()
})
// 暴露方法
defineExpose({
getId
})
detail
javascript
import { ref, onMounted, onUnmounted } from 'vue'
import { onLoad,onBackPress } from '@dcloudio/uni-app'
const buildObj = ref({})
onLoad((options) => {
editId.value = options.id
getDetail(options.id)
buildObj.value = options.buildObj;
})
onBackPress((options) => {
// 把数据传到上一页
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm._.exposed.getId(buildObj.value)
})