diff --git a/apps/web-test/src/views/dashboard/home/components/GridGroup/index.vue b/apps/web-test/src/views/dashboard/home/components/GridGroup/index.vue index b78b2838..da5196b5 100644 --- a/apps/web-test/src/views/dashboard/home/components/GridGroup/index.vue +++ b/apps/web-test/src/views/dashboard/home/components/GridGroup/index.vue @@ -1,10 +1,12 @@ - {{ rowHeight }} + { cardName.value = newCardName.value; }; const { data } = toRefs(props); + +const gridLayoutRef = ref(null); + +setTimeout(() => { + console.log(gridLayoutRef.value); +}, 1000); + +const handleGridLayoutRef = (ref) => { + // 这里可以处理孙组件传递过来的 ref + console.log('子组件 B 收到孙组件的 ref:', ref.value); +}; + +defineExpose({ + childRef: gridLayoutRef.value, +}); @@ -53,7 +68,12 @@ const { data } = toRefs(props); - +