Named Views
When a page wants to show multiple views, rather than nested show, you need to use a named view. Have multiple individual named in the interface view, rather than just a single outlet. If you router-view
do not set the name, the default name for thedefault
<!-- 设置多个视图出口 -->
<router-view></router-view>
<router-view name="leftMenu"></router-view>
<router-view name="rightContent"></router-view>
Since a view corresponding to a render component outlet, and therefore, for the same route, a plurality of assemblies requires multiple views. The routing configuration components
component must be configured withs
<script>
const router = new VueRouter({
routes: [
path: '/',
components: {
'default': Header,
'leftMenu': Menu,
'rightContent': Content
}
]
})
</script>