父组件
<template>
<div>
<Son2 :fatherData="fatherData"></Son2>
</div>
</template>
<script setup>
import Son2 from '@/components/son2.vue';
import {ref} from 'vue';
const fatherData = ref('father');
</script>
子组件
<template>
<div>
{{ fatherData }}
</div>
</template>
<script setup>
defineProps({
fatherData: {
type: String
}
});
</script>