接口调试完毕
This commit is contained in:
@@ -17,7 +17,7 @@ const props = defineProps({
|
||||
},
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: (arrow) => {},
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ const dragStartPos = ref({ x: 0, y: 0 });
|
||||
|
||||
// 点击靶纸创建新的点
|
||||
const onClick = async (e) => {
|
||||
if (arrow.value !== null) return;
|
||||
if (arrow.value !== null || !props.onChange) return;
|
||||
const newArrow = {
|
||||
x: e.detail.x - (rect.value.width * 0.1) / 2,
|
||||
y: e.detail.y - rect.value.top - 10,
|
||||
@@ -45,7 +45,8 @@ const onClick = async (e) => {
|
||||
|
||||
// 确认添加箭矢
|
||||
const confirmAdd = () => {
|
||||
props.onChange(arrow.value);
|
||||
if (props.onChange)
|
||||
props.onChange({ ...arrow.value, ring: arrow.value.ring || "M" });
|
||||
arrow.value = null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user