vue的父子通信

**父子通信是通过props**
 
    1.在父组件中挂载的子组件上通过v-bind(简写:),绑定数值
    2.在子组件上个props接收绑定的名字,直接在页面上{{}}就可以啦
 
***父组件***
<template>
    <div class="app">
        <child :hehe="msgFormSon"></child>
    </div>
</template>
<script>
import child from './child.vue'
export default {
    data () {
        return {
            msgFormSon: "this is msg"
        }
    },
}
</script>

***子组件***

<template>  
   <div class="app">
      {{hehe}}
   </div>
</template>
<script>
export default {
    props:['hehe'],
    data () {
        return {
        }
    },
}
<script>
原文地址:https://www.cnblogs.com/Jerry1208/p/11850260.html