VUE component communication

Communication methods between VUE components:
1. Parent-child component event communication, generally based on props to pass values ​​(officially it is not recommended to pass objects, because the child component changes the state of the parent component, and if the parent component is referenced elsewhere, the state will also change.)
2. Child The component communicates with the parent component, usually using the on and emit processing methods (registration/listening)
3. Through the channel (additionally create a vue component, similar to the appController of angularjs)
reference: https://jingyan.baidu.com/article/2f9b480de305bc41cb6cc20e. html
4. Import bus by way of event bus


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326098094&siteId=291194637