去掉webstorm的报错

master
wyj2080 6 years ago
parent cdec3f4149
commit 04f8981c83

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<Menu mode="horizontal" :active-name="selectedItemName"> <Menu ref="menu" mode="horizontal" :active-name="selectedItemName">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel" <MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id"> :key="cItem.id">
{{cItem.name}} {{cItem.name}}
@ -21,6 +21,10 @@
selectedItemName: null, selectedItemName: null,
} }
}, },
created() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
mounted() { mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel")); this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit(); this.menuInit();
@ -28,9 +32,9 @@
methods:{ methods:{
menuInit(){ menuInit(){
let that = this; let that = this;
that.selectedItemName = [that.threeLevel[0].id]; that.selectedItemName = that.threeLevel[0].id;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.menu.updateActiveName(); that.$refs.menu.updateActiveName();
}); });
} }
} }

Loading…
Cancel
Save