Why are the subcomponents displayed by routing in the wrong location?

index.vue:

<template>
   <div>
    <el-row class="container">
      <el-col :span="24" class="topbar-wrap">
        <div class="topbar-logo topbar-btn">
          <a href="/"><img src="../assets/logo.png"></a>
        </div>
        <div class="topbar-logos">
            <a href="/"><img src="../assets/logotxt.png"></a>
        </div>
        <div class="topbar-title">
            <span></span>
        </div>
        <el-dropdown class="dropdown">
          <span class="el-dropdown-link">
            <i class="iconfont"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item></el-dropdown-item>
            <el-dropdown-item></el-dropdown-item>
            <el-dropdown-item></el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </el-col>
      <el-col :span="24" class="main">
         <el-menu
         router
      :default-active="this.$router.path"
      class="el-menu-vertical-demo"
      >
      <el-menu-item index="/">
        <i class="iconfont"></i>
        <span slot="title"></span>
      </el-menu-item>
      <el-menu-item index="/userlist">
          <i class="iconfont"></i>
          <span slot="title"></span>
      </el-menu-item>
      <el-submenu index="/book">
        <template slot="title">
          <i class="iconfont white"></i>
          <span slot="title" class="white"></span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="/book/list"></el-menu-item>
          <el-menu-item index="/book/category"></el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="/set">
        <template slot="title">
          <i class="iconfont"></i>
          <span slot="title" class="white"></span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="/set/personinfo"></el-menu-item>
          <el-menu-item index="/set/changepwd"></el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
        <el-col :span="24" class="content-wrapper">
          <transition name="fade" mode="out-in">
            <router-view></router-view> 
          </transition>
        </el-col>
      </el-col>
    </el-row>
   </div>
</template>
<script>
export default {
  data () {
    return {
      name: "Home"
    }
  }
}
</script>
<style lang="scss" scoped>
</style>

userList.vue:


 <template>
    <el-row class="wrap">
        <el-col :span="24" class="warp-breadcrum">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: "/" }"></el-breadcrumb-item>
                <el-breadcrumb-item></el-breadcrumb-item>
           </el-breadcrumb>
        </el-col>

        <el-col :span="24" class="warp-min" v-loading="loading"  element-loading-text=""
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.8)"
        >
            <el-col :span="24" class="toolbar">
                <el-form :inline="true" :model="formInline" class="demo-form-inline" align="left">
                   <el-input v-model="formInline.user" placeholder="//" style="min-width: 240px;"></el-input>
                    <el-button type="primary" @click="onSubmit"></el-button>
                </el-form>
            </el-col>

             <el-table
                :data="users"
                highlight-current-row
                v-loading="loading"
                align="center">
                    <el-table-column    
                        prop="name"
                        label=""
                        width="120"
                        sortable>
                    </el-table-column>
                    <el-table-column
                        prop="nickname"
                        label=""
                        width="120"
                        sortable>
                    </el-table-column>
                    <el-table-column
                        prop="sex"
                        label=""
                        width="100"
                        sortable>
                    </el-table-column>
                    <el-table-column
                        prop="email"
                        label=""
                        width="160"
                        sortable>
                    </el-table-column>
                    <el-table-column
                        prop="address"
                        label=""
                        sortable>
                    </el-table-column>
                </el-table>
        </el-col>

    </el-row>
</template>
<script>
export default {
  name: "UserList",
  data() {
      return {
        loading: false,
        formInline: {
          user: ""
        },
        users: [{
            nickname: "",
            name: "",
            sex: "",
            email: "chunzhou@163.com",
            address: " 1518 "
          }, {
            nickname: "",
            name: "",
            sex: "",
            email: "chunzhou@163.com",
            address: " 1518 "
          }, {
           nickname: "",
            name: "",
            sex: "",
            email: "chunzhou@163.com",
            address: " 1518 "
          }, {
           nickname: "",
            name: "",
            sex: "",
            email: "chunzhou@163.com",
            address: " 1518 "
          }]
      }
    },
    methods: {
      onSubmit() {
        console.log("submit!");
      }
    }
}
</script>
<style lang="scss" scoped>
    .demo-form-inline{
        margin-top: 20px;
    }
    .el-input{
        width: 10%
    }
</style>

clipboard.png"" :

clipboard.png
index.vue:

clipboard.png

how to solve

Jul.17,2021

this is a problem of routing configuration, which requires nested routing if you want to implement the outer structure. Excuse me for answering on mobile phone

{

  path: '/index',
  component: Layout,
  children: [
    {
      path: 'user,
      component: User
    }
  ]
}

write a common home component, introduce sidebar, header, main content area, bottom component,
route to content area and try

 <v-head></v-head>
        <v-sidebar></v-sidebar>
        <div class="content-box" :class="{'content-collapse':collapse}">
            <v-tags></v-tags>
            <div class="content">
                <transition name="move" mode="out-in">
                    <router-view></router-view>
                </transition>
            </div>
            <v-footer></v-footer>
        </div>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e50fde-4463d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e50fde-4463d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?