Front-end and back-end separation project—universal back-end management system (Vue + SpringBoot) [4]

Universal backend management system

This system mainly combinesElement component editing front-end and back-end to implement business logic, forming a simple front-end and back-end separation project.

This section introduces the implementation of the breadcrumb function

page

ElementThere is also this component, which can be used directlyel-breadcrumb

		<!--面包屑-->
      <el-breadcrumb separator="/" >
        <el-breadcrumb-item class="myColor" v-for="item in tags" :key="item.path" :to="{ path: item.path }">{
   
   {item.label}}</el-breadcrumb-item>
      </el-breadcrumb>

Click menu function

	handleMenu() {
    
    
      this.$store.commit('collapseMenu')
    }
 computed: {
    
    
    // ... 解构
    ...mapState({
    
    
      tags: state => state.tab.tabsList
    })
  }

top bar

The top bar page is as follows: There is a menu button at the left end. Click to collapse the menu bar in the left column. A small logo is placed at the right end and the current page is highlighted.
Insert image description here

<template>
  <div class="header-content">
    <div class="l-content">
      <el-button style="margin-right: 20px" @click="handleMenu" icon="el-icon-menu" size="medium"></el-button>
      <!--面包屑-->
      <el-breadcrumb separator="/" >
        <el-breadcrumb-item class="myColor" v-for="item in tags" :key="item.path" :to="{ path: item.path }">{
   
   {item.label}}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="r-content">
      <el-dropdown>
  <span class="el-dropdown-link">
    <img class="user" src="../static/logo.png" alt="">
  </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>
<style lang="less" scoped>
.header-content {
    
    
  padding: 0 20px;
  background: #333;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .text {
    
    
    color: #fff;
    font-size: 14px;
    margin-left: 10px;
  }

  .r-content {
    
    
    .user {
    
    
      width: 40px;
      height: 40px;
      border-radius: 50%;
    }
  }
  .l-content{
    
    
    display: flex;
    align-items: center;
    .myColor /deep/ .el-breadcrumb__inner {
    
    
      color:#666;
    }
    /deep/.el-breadcrumb__item{
    
    
      .el-breadcrumb__inner{
    
    
        font-weight: normal;
      }
      // 伪类
      &:last-child{
    
    
        .el-breadcrumb__inner{
    
    
          color: white;
        }
      }
    }
  }
}
</style>

Guess you like

Origin blog.csdn.net/weixin_55488173/article/details/134602673