方法:
$emit
使用:
父组件:
<template> <div>
<LoginOrReg v-if="isLogin" @hidden = 'hidden'></LoginOrReg>
</div></template>
methods: { hidden () { this.isLogin = false } }}</script>
子组件:
this.$emit('hidden')