王智慧 3 лет назад
Родитель
Сommit
e417557894
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 1
      src/layout/Aside.vue
  2. 1 1
      src/layout/Layout.vue

+ 2 - 1
src/layout/Aside.vue

@@ -1,6 +1,6 @@
 <template>
   <el-menu
-    :default-active="this.$store.state.currentMenuItem"
+    :default-active="store.state.currentMenuItem"
     style="width: 220px; height: 100%"
     background-color="#141B29"
     text-color="#fff"
@@ -27,6 +27,7 @@
 </template>
 <script setup>
 import { ref } from "vue";
+import store from "../store";
 
 let defaultActive = ref();
 function changeIndex(path) {

+ 1 - 1
src/layout/Layout.vue

@@ -2,7 +2,7 @@
   <HeaderVue v-if="store.state.isLogin" class="header"></HeaderVue>
   <div v-if="store.state.isLogin" class="aside"><AsideVue></AsideVue></div>
   <div v-if="store.state.isLogin && route.path != '/index'" class="first-title">
-    {{ this.$store.state.firstTitle }}
+    {{ store.state.firstTitle }}
   </div>
   <div
     :class="[