How do you eventBus a bus to communicate updates to a view in a Vue component?

后端 未结 2 521
失恋的感觉
失恋的感觉 2021-01-23 03:00

Listen for custom events for the bus in component b. However, after dispatching events in component a, it accesses component b. the listening function of component b is executed

2条回答
  •  再見小時候
    2021-01-23 03:37

    Your code will not work as expected as your are changing route after emitting event from Component A. So it can't be catch by Component B.

    You can save the changed value in mixing look here for mixins or use localstorage. And you can also use query string as stated in previous answer

提交回复
热议问题