需求:Vue3 setup
父组件向子组件传值,子组件接收父组件传入的值;子组件向父组件传值,父组件接收的子组件传递的值。
父组件:parent.tsx
:
import {
defineComponent, ref, reactive } from 'vue';
import TotalPreview from './components/TotalPreview'
export default defineComponent({
name: 'parent',
components: {
TotalPreview },
setup() {
const count = ref(123);
const childNum = reactive({
num