leftAside.vue 913 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div>
  3. <el-menu
  4. :default-active="defaultUrl"
  5. class="el-menu-vertical-demo"
  6. background-color="#545c64"
  7. text-color="#fff"
  8. active-text-color="#ffd04b"
  9. :router="true"
  10. >
  11. <el-menu-item
  12. v-for="(route, key) in routers"
  13. :key="key"
  14. :index="route.router"
  15. >
  16. <i class="el-icon-menu"></i>
  17. <span slot="title">{{ route.name }}</span>
  18. </el-menu-item>
  19. </el-menu>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. routers: [
  27. {
  28. name: "交付范围",
  29. router: "workscope",
  30. },
  31. {
  32. name: "生成二维码",
  33. router: "qrcode",
  34. },
  35. {
  36. name: "空间任务",
  37. router: "spacetask",
  38. },
  39. ],
  40. defaultUrl:''
  41. };
  42. },
  43. created(){
  44. this.defaultUrl = this.$route.name;
  45. }
  46. };
  47. </script>