SideBar.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <SideBarItem :menuList="menuList" />
  3. </template>
  4. <script>
  5. import SideBarItem from "./SideBarItem.vue";
  6. import { mapGetters } from "vuex";
  7. export default {
  8. components: {
  9. SideBarItem,
  10. },
  11. computed: {
  12. ...mapGetters("user", ["userInfoLogin"]),
  13. },
  14. data() {
  15. return {
  16. activeMenuName: "/targetImprove",
  17. menuList: [
  18. {
  19. icon: "icon_baxiangzizhulianxi",
  20. externalLink: "/targetImprove/pracice",
  21. menuName: "靶向自主练习",
  22. },
  23. {
  24. icon: "icon_baxiangcuotifupan",
  25. externalLink: "/targetImprove/consolidate",
  26. menuName: "靶向错题复盘",
  27. },
  28. ],
  29. allMenuList:[],//总菜单
  30. };
  31. },
  32. watch: {
  33. userInfo: {
  34. handler(newValue, oldValue) {
  35. console.log(newValue, oldValue);
  36. },
  37. deep: true, // 监听对象的深层变化
  38. },
  39. },
  40. created() {
  41. console.log("打印个人中心菜单this.userInfo",this.userInfo);
  42. },
  43. mounted() {
  44. // this.activeMenu();
  45. },
  46. methods: {
  47. // activeMenu() {
  48. // const route = this.$route;
  49. // const { path } = route;
  50. // if (path == "/userInfo") {
  51. // this.activeMenuName = "/userInfo/personInfo";
  52. // }
  53. // },
  54. },
  55. };
  56. </script>
  57. <style lang="scss" scoped></style>