Przeglądaj źródła

更新 简化代码

wzh 3 lat temu
rodzic
commit
a81de3700b
1 zmienionych plików z 2 dodań i 36 usunięć
  1. 2 36
      src/components/Aside.vue

+ 2 - 36
src/components/Aside.vue

@@ -16,45 +16,11 @@
         <i :class="item.icon"></i>
         <span>{{ item.title }}</span>
       </template>
-      <el-menu-item
-        v-for="son in item.items"
-        :index="son.path"
-        :key="son"
-        @click="changeIndex(son.path)"
-      >
+      <el-menu-item v-for="son in item.items" :index="son.path" :key="son">
         {{ son.name }}
       </el-menu-item>
     </el-sub-menu>
   </el-menu>
 </template>
-<script>
-import { ref } from "vue";
-import menuData from "../auth/menuData";
-export default {
-  setup() {
-    let defaultActive = ref();
-    function changeIndex(path) {
-      defaultActive.value = path;
-    }
-    let menu = [
-      {
-        icon: "el-icon-s-data",
-        title: "航次",
-        items: [
-          {
-            path: "/voyage/voyageList",
-            name: "航次列表",
-          },
-        ],
-      },
-    ];
-
-    return {
-      changeIndex,
-      defaultActive,
-      menu,
-      menuData,
-    };
-  },
-};
+<script setup>
 </script>