一、父传子
第一部分:父组件代码
<template>
<div>
父组件【父传子】::===>{
{ state.chuanValue }}
<Son :chuanValue="state.chuanValue"></Son>
</div>
</template>
<script>
import Son from "./Son";
import {
reactive } from "vue";
export default {
components: {
Son,
},
setup() {
const state = reactive({
chuanValue: "fatherData",
});
return {
state,
};
},
};