Vue's < router-view > loaded parallel sibling component, how to intermodulate the method?

                    <ul class="nav">
                        <li @click="jump("/businessManage/x")"></li>
                        <li @click="jump("/businessManage/y")"></li>
                        <li @click="jump("/businessManage/z")"></li>
                    </ul>
                    <keep-alive>
                        <router-view></router-view>
                    </keep-alive>
                
                 a.vueb.vueeventBusVuex
Mar.18,2021

you can't call this, through the two components loaded by < router-view >, one is in, the other is not in dom,. If you want to exchange data, just use vuex.


if the project is simple, learn about the central bus event of vue. If the project is large, or if the project will be upgraded step by step later, it is recommended to use status management vuex

Menu