Skip to content

KLCrosshair

考拉十字辅助线组件

效果

vue
<script setup lang="ts">
import { ref } from 'vue';
const height = 400;
const point = ref({ x: 100, y: height / 2 });
const lock = ref(false);
</script>

<template>
  <div class="relative" :style="{ height: height + 'px', background: '#ccc', }">
    <KLCrosshair :coor="point" color="#f00" :lock="lock" />
    <KLButton :content="lock ? '解锁辅助线' : '固定辅助线'" @click="lock = !lock" />
  </div>
</template>

Attributes

属性说明类型默认值
coor辅助线坐标{x: number, y: number}-
color辅助线颜色string-
lock是否固定辅助线(此时拖拽辅助线事件失效)booleanfalse