父组件 <template> <div class="home"> <div class="test"> <h1 class="title" @click="add = true">显示提示框</h1> <HelloWorld :add.sync="add" v-if="add"/> </div> </div> </template> <script> import HelloWorld from '@/components/HelloWorld.vue' export default { name: 'Home', components: { HelloWorld }, data(){ return { add:false } } } </script> 子组件 <template> <div class="hello"> <p> For a guide and recipes on how to configure / customize this project,<br> check out the <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>. <button type="button" &