子组件
<div style="margin-top:20px;font-size:14px;">
<span>已经拥有账户?</span>
<span> <el-button type="text" @click="handleClick()">登录</el-button> </span>
</div>
handleClick(){
this.$emit("childValue",false)
}
点击按钮,子组件向父组件传值,值发生变化
父组件
<div class="login-right" v-if="isShow" >
<Passin v-else v-on:childValue="update"/> //与子组件childValue自定义事件保持一致
</div>
methods:{
update(e) {
//this.isShow = !e
},
}