Vue提升06 组件间通讯

父子组件通讯 父组件向子组件传递数据 父组件向子组件传递数据,直接使用prop便可,父组件中在子组件的实例上经过v-bind传入prop:html <LeftChild :message="myMessage"></LeftChild> 在子组件中声明了这个prop以后就可使用:vue <template> <h1>{{message}}</h1> </template> <script>
相关文章
相关标签/搜索