index.vue 689 Bytes
Newer Older
geqilin's avatar
geqilin committed
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
<template>
  <div>
    <menu-component class="monitor_menu" :menuList="list" :active="active"></menu-component>
  </div>
</template>
<script>
import menuComponent from '../components/menu-component'
import { mapState } from 'vuex'
export default {
  data() {
    return {
        list: [],
        active: ''
    }
  },
  components: {
    menuComponent
  },
  computed: {
    ...mapState('d2admin/menu', [
      'header'
    ])
  },
  created () {
    this.header.forEach(res => {
      if (res.path === '/alarms') {
        this.list = res.list
        this.active = res.list[0].path
        this.$router.push({
          path: res.list[0].path
        })
      }
    })
  }
}
</script>