zhangzengfei
2022-08-19 3e4904fda5c78cfd8b40fa925fd2970b01850224
src/views/personalCenter/components/LeftMenu.vue
@@ -8,10 +8,10 @@
    <div class="menu-list">
      <div
        class="item"
        @click="pickMenu(index)"
        v-for="(item, index) in menuList"
        :key="index"
        :class="index == activeIndex ? 'active-item' : ''"
        @click="pickMenu(index, item.tab)"
      >
        <span class="iconfont">&#xe614;</span>
        <span class="item-name"> {{ item.name }}</span>
@@ -23,31 +23,31 @@
<script>
export default {
  created() {
    this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
    this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
    if (this.$route.query && this.$route.query.id) {
      this.activeIndex = this.$route.query.id;
      this.activeIndex = this.$route.query.id
    }
  },
  data() {
    return {
      menuList: [
        // { name: "账户总览" },
        { name: "订单管理" },
        // { name: "订单管理" },
        // { name: "消息中心" },
        { name: "基本资料" },
        { name: "子账户管理" },
        { name: "基本资料", tab: "baseInfo" },
        { name: "子账户管理", tab: "subAccount" }
      ],
      userInfo: null,
      activeIndex: 0,
    };
      activeIndex: 0
    }
  },
  methods: {
    pickMenu(i) {
      this.activeIndex = i;
      this.$emit("mChange", i);
    },
  },
};
    pickMenu(idx, tab) {
      this.activeIndex = idx
      this.$emit("mChange", tab)
    }
  }
}
</script>
<style scoped lang="scss">
@@ -94,4 +94,4 @@
    }
  }
}
</style>
</style>