- watch: {
- isActive: {
- async handler(oldV, newV) {
- console.log(oldV, newV);
- console.log("变化了");
- if (oldV === "middle") {
- this.zIndexMiddle = 100;
- this.zIndexLeft = 50;
- this.zIndexRight = 40;
- console.log("设置中间的z-index");
- } else if (oldV === "right") {
- this.zIndexRight = 100;
- this.zIndexMiddle = 45;
- this.zIndexLeft = 50;
- console.log("设置右边的z-index");
- } else if (oldV === "left") {
- this.zIndexLeft = 100;
- this.zIndexMiddle = 45;
- this.zIndexRight = 40;
- console.log("设置左边的z-index");
- }
- },
- immediate: true,
- },
- },