|
|
@@ -80,13 +80,13 @@ path.bus.on("changeLineHeight", (val) => {
|
|
|
});
|
|
|
|
|
|
watchEffect(() => {
|
|
|
- console.log('changePointDisplay', props.path)
|
|
|
path.changeName(props.path.name);
|
|
|
});
|
|
|
|
|
|
watch(
|
|
|
() => props.path.points.map((i) => ({ modelId: i.modelId, position: i.position })),
|
|
|
(p) => {
|
|
|
+ console.log(p, 'watchEffect0', props.path.points);
|
|
|
changPointsTimeout = setTimeout(() => {
|
|
|
if (inRevise(props.path.points, currentPoints)) {
|
|
|
path.changePathPoints(p);
|
|
|
@@ -98,17 +98,34 @@ watch(
|
|
|
);
|
|
|
|
|
|
watchEffect(() => {
|
|
|
- for (const point of props.path.points) {
|
|
|
- watchEffect(() => {
|
|
|
- const ndx = props.path.points.indexOf(point);
|
|
|
- console.log(ndx, 'watchEffect', ~ndx, props.path);
|
|
|
- if (~ndx) {
|
|
|
- path.changePointName(ndx, point.name);
|
|
|
- path.changePointDisplay && path.changePointDisplay(ndx, props.path.show || false);
|
|
|
- currentPoints[ndx].name = point.name;
|
|
|
+ props.path.points.forEach((point, index) => {
|
|
|
+ // 监听 name 属性
|
|
|
+ watch(() => point.name, (newName) => {
|
|
|
+ path.changePointName(index, newName);
|
|
|
+ currentPoints[index].name = newName;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 监听 hide 属性
|
|
|
+ watch(() => point.hide, (newHide) => {
|
|
|
+ if (path.changePointDisplay) {
|
|
|
+ path.changePointDisplay(index, !newHide);
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ });
|
|
|
+ // for (const point of props.path.points) {
|
|
|
+ // watchEffect(() => {
|
|
|
+ // const ndx = props.path.points.indexOf(point);
|
|
|
+ // console.log(ndx, 'watchEffect', ~ndx, 'point' ,point, props.path);
|
|
|
+ // if (~ndx) {
|
|
|
+ // path.changePointName(ndx, point.name);
|
|
|
+ // path.changePointDisplay && path.changePointDisplay(ndx, !point.hide);
|
|
|
+ // currentPoints[ndx].name = point.name;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+},{ deep: true, flush: "post" });
|
|
|
+watchEffect(() => {
|
|
|
+ path.changeDirection(props.path.showDirection, props.path.reverseDirection);
|
|
|
});
|
|
|
|
|
|
let currentLine = getLineProps();
|