父组件传值子组件:
<template>
<div>
<h1>父组件</h1>
<son :value="parentValue"></son>
</div>
</template>
<script setup>
import { ref } from 'vue'
import son from './components/son.vue'
const parentValue = ref('父传给子的值')
</script>
子组件通过props接收
<template>
<div>
<h1>子组件</h1>
<div>{{ value }}</div>
</div>
</template>
<script setup>
import { ref, defineProps } from 'vue'
const props = defineProps({
value: {}
})
const isValue = ref(props.value)
</script>