父组件
<script setup lang="ts">
import { ref } from 'vue'
import child1 from './com-child1.vue'
const house = ref('宝马')
const money = ref(undefined)
const gift = ref('')
const getchildGift = (val: string) => {
console.log(val)
gift.value = val
}
</script>
<template>
<h1>father</h1>
<h3>子组件传递过来的:{
{ gift }}</h3>
<child1 :house="house" :money="money" @getchildGift="getchildGift"></child1>
</template>
<style scoped></style>
ift
子组件
import { ref } from "vue" import { ref } from "vue"
<template>
house
<h2>child1</h2>
<el-button @click="clickMe">点击给父组件</el-button>
<h2>child1</h2>
<h3>父组件传递过来的:{
{ house }}--{