because of its high repeatability, it is now packaged into a component, Baidu
Sub-component:
<template>
<div>
<div class="group">
<label>{{title}}</label>
<input type="text" placeholder="" @input="changeData()" v-model="val">
</div>
</div>
</template>
<script>
export default {
props:["title"],
data () {
return {
val:""
}
},
methods:{
changeData:function(){
console.log(111);
this.$emit("input",this.val);
}
}
}
</script>
parent component:
<cmsGroup title="" v-model="username"></cmsGroup>
what does the subcomponent this.$emit ("input",this.val); mean? the official website says: this.$emit (event, value) but my parent component doesn"t use events, and the effect comes out. I don"t understand what the "input"" really is here
.