quanyawei
2024-06-18 6b7604951f61b7033cc643afe0e4ca67565a1a36
src/layout/components/Sidebar/index.vue
@@ -1,6 +1,9 @@
<template>
  <div :class="{ 'has-logo': showLogo }">
    <logo v-if="showLogo" :collapse="isCollapse" />
    <logo
      v-if="showLogo"
      :collapse="isCollapse"
    />
    <!-- <div class="logo" style="display:flex;background: #0f4567;">
      <img
        style="width: 20px; height: 30px;margin: 8px 0 11px 18px"
@@ -38,7 +41,7 @@
export default {
  components: { SidebarItem, Logo },
  data() {
  data () {
    return {
      logo: require('@/assets/images/LOGO.png'),
      logoDisplay: this.$store.state.logoDisplay
@@ -48,14 +51,15 @@
    ...mapGetters([
      'sidebar'
    ]),
    sidebar() {
    sidebar () {
      console.log('左边sidebar', this.$store.state.app.sidebar)
      return this.$store.state.app.sidebar
    },
    routes() {
      // console.log(this.$router.options.routes)
    routes () {
      console.log('左边routes', this.$router.options.routes)
      return this.$router.options.routes
    },
    activeMenu() {
    activeMenu () {
      const route = this.$route
      const { meta, path } = route
      // if set path, the sidebar will highlight the path you set
@@ -64,13 +68,13 @@
      }
      return path
    },
    showLogo() {
    showLogo () {
      return !this.$store.state.settings.sidebarLogo
    },
    variables() {
    variables () {
      return variables
    },
    isCollapse() {
    isCollapse () {
      return !this.sidebar.opened
    }
  }