<el-dropdown-menu slot="dropdown"> <el-dropdown-item command="1">更换背景</el-dropdown-item> <el-dropdown-item command="2">退出登录</el-dropdown-item> </el-dropdown-menu> 。。。 data() { return { imgSrc: require("../assets/bar2.png"), imgSrc2: require("../assets/bar6.png"), 。。。 selectSide(command) { switch (command) { case "1": this.sideBarImg = !this.sideBarImg; this.$router.push("/loginRecord"); break; case "2": this.handleOut(); break; default: return; } }, .sideBg { height: 100%; z-index: -1; position: absolute; } .sideC { z-index: 1; position: absolute; }