diff --git a/src/component/Canvas/CanvasEditor/commands/LayerCommands.js b/src/component/Canvas/CanvasEditor/commands/LayerCommands.js index 692b16ea..67cb05e4 100644 --- a/src/component/Canvas/CanvasEditor/commands/LayerCommands.js +++ b/src/component/Canvas/CanvasEditor/commands/LayerCommands.js @@ -528,6 +528,7 @@ export class RemoveLayerCommand extends Command { this.layerIndex = this.layers.value.findIndex( (layer) => layer.id === this.layerId ); + this.removedLayer = this.layers.value[this.layerIndex]; this.isActiveLayer = this.layerId === this.activeLayerId.value; @@ -593,6 +594,9 @@ export class RemoveLayerCommand extends Command { } }); + this.layerIndex = this.layers.value.findIndex( + (layer) => layer.id === this.layerId + ); // 从图层列表中删除 this.layers.value.splice(this.layerIndex, 1);