<!-- 绘制点 -->
          <v-circle ref='circle' v-for='(el, index) in anchors' :config='{
            x: el.x, y: el.y, radius: 10,
            fill: activeIndex == 1 ? findAnchorsById(el.id) ? 'lightgrey' : '#34FFFF' : fillIndex == index ? 'red' : '#34FFFF',
            stroke: findAnchorsById(el.id) ? 'white' : 'black', strokeWidth: findAnchorsById(el.id) ? 2 : 1,
            id: index
          }' :key='index + 'circle1'' @mousedown='handelCircleMousedownEvent(el, index, $event)' />

怎么设置层级关系

要设置层级关系,可以使用 CSS 的 z-index 属性。通过给不同的元素设置不同的 z-index 值,来控制它们在层级中的显示顺序。

在 Vue 组件中,可以使用 style 属性来设置元素的样式,其中包括 z-index 属性。例如,可以给 v-layer 组件添加一个 style 属性来设置其层级关系,如下所示:

<v-layer ref='layer' style='z-index: 1;'>
  <!-- 其他内容 -->
</v-layer>

这样,v-layer 组件就会处于较高的层级,可以覆盖其他具有较低层级的元素。根据需要,可以调整不同组件的 z-index 值来调整它们在层级中的显示顺序。

Vue 组件层级关系设置:使用 z-index 控制元素显示顺序

原文地址: https://www.cveoy.top/t/topic/pgtz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录