Home  >  Article  >  Web Front-end  >  How to use vue parent-child component communication

How to use vue parent-child component communication

php中世界最好的语言
php中世界最好的语言Original
2018-04-14 17:03:361146browse

This time I will bring you how to use vue parent-child component communication. What are the precautions when using vue parent-child component communication. The following is a practical case, let's take a look.



 
 
 组件父子间通信之综合练习
 
 
   

  

{{msg}}

    

   

Comprehensive exercises for communication between components:
(props down, events up)
There are 2 components: chat-room, user-component
user-component is composed of label input button
chat-room is Composed of two user-component and a list

① Call user-component in chat-room to specify the name of the label
② When user-component,
clicks the button , the information entered by the current user is sent to the chat-room component, chat- Room receives data and displays it in the list

Code:




 
 
 

 

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

mint-ui loadmore Pull-up loading and pull-down refresh conflict handling method

Templates in ES6 Detailed explanation of string usage

The above is the detailed content of How to use vue parent-child component communication. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn