所以,我一直在使用 vue-konva,我有这样的事情:
<v-container>
<v-stage ref="stage">
<v-layer ref="baseImage">
<v-image>
</v-layer>
<v-layer ref="annotationLayer">
<v-rect ref="eventBox">
<v-rect ref="rubberBox">
<v-rect ref="annotationRect">
</v-layer>
</v-stage>
<v-container>
目前,如果我想绘制新框,当图像上已有其他 annotationRects 时,会出现一些问题。因为它们在技术上位于 eventBox 和 Rubberbox 之上,所以当光标位于现有 annotationRect 之上时,它们会“阻止”这两个层。
但是,我不想总是让 eventBox 和 RubberBox 在 annotationRect 之上,因为我需要能够与 annotationRect 交互以移动它们、调整它们的大小等。
有没有办法让我重新排序 eventBox、rubberBox 和 annotationRect,即将顺序从原始 eventBox-rubberBox-annotationRect 更改为(从下到上)annotationRect-eventBox-rubberBox 并返回,例如当 vue组件从另一个组件接收事件?