影片中没有录到父组件的代码,我列在这里,以免学习上的断点
<template>
<div id="app">
<event :name="name" @change="handleEventChange"></event>
</div>
</template>
<script>
import Event from "./Event"
export default{
components:{
Event,
},
data:()=>{
return {
name:"",
}
},
methods:{
handleEventChange(val){
this.name = val;
}
}
}
</script>
展开