<template>
    <div>
        <Menu mode="horizontal"  :active-name="selectedItemName">
            <MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
                      :key="cItem.id">
                {{cItem.name}}
            </MenuItem>
        </Menu>
        <div>
            <router-view/>
        </div>
    </div>
</template>

<script>
    export default {
        name: "IncreaseData",
        data() {
            return {
                threeLevel: null,
                selectedItemName: null,
            }
        },
        mounted() {
            this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
            this.menuInit();
        },
        methods:{
            menuInit(){
                let that = this;
                that.selectedItemName = [that.threeLevel[0].id];
                this.$nextTick(() => {
                    this.$refs.menu.updateActiveName();
                });
            }
        }
    }
</script>

<style scoped>

</style>
