dcc
2024-06-13 3616db170333df7d668c97323344335b52c4153c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!-- 布局入口 -->
<template>
  <div class="app-box">
    <div class="box-view">
      <!-- left -->
      <div class="left-view">
        <div
          v-for="(it, i) in qianbaoList"
          :key="i"
          class="menu-list"
          :class="selectPath == it.urlPath ? 'menu-active-color' : ''"
          @click="goRouter(it.urlPath)"
        >
          <div
            :class="selectPath == it.urlPath ? 'item-active-line' : ''"
          ></div>
          <img :src="it.iconPath" class="icon" />
          <span>{{ $t(`message.user.${it.title}`) }}</span>
        </div>
      </div>
      <!-- right -->
      <div class="right-view">
        <router-view />
      </div>
    </div>
  </div>
</template>
 
<script setup>
import { useRoute, useRouter } from "vue-router";
import { qianbaoList } from "@/utils/menuConfig";
const router = useRouter();
const route = useRoute();
const selectPath = ref("");
 
watch(
  () => route.path,
  (newPath, oldPath) => {
    selectPath.value = newPath;
  },
  { immediate: true }
);
 
const goRouter = (parmas) => {
  router.push(parmas);
};
</script>
 
<style scoped>
.icon {
  width: 22px;
  height: 22px;
  margin: 0 10px;
}
</style>