bill 8 ماه پیش
والد
کامیت
7774b1cb24
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 6 2
      src/components/path/sign.vue
  2. 1 1
      src/sdk/sdk.ts

+ 6 - 2
src/components/path/sign.vue

@@ -53,10 +53,14 @@ const toCameraDistance = ref(path.toCameraDistance);
 path.bus.on("toCameraDistanceChange", (v) => (toCameraDistance.value = v));
 const show = computed(
   () =>
+    !props.path.points.length ||
     props.path.globalVisibility ||
     toCameraDistance.value <= Math.pow(props.path.visibilityRange, 2)
 );
-watchEffect(() => path.visibility(show.value));
+watchEffect(() => {
+  console.error("globalVisibility", show.value);
+  path.visibility(show.value);
+});
 
 let currentPoints = props.path.points;
 let changPointsTimeout: any;
@@ -124,7 +128,7 @@ path.bus.on("linePositionChange", (position) => {
 
 onUnmounted(() => {
   console.error(path, "destory");
-  path.destory();
+  path.destroy();
 });
 defineExpose(path);
 </script>

+ 1 - 1
src/sdk/sdk.ts

@@ -268,7 +268,7 @@ export type Path = {
   // 距离相机位置
   toCameraDistance: number
   // 线段销毁
-  destory: () => void
+  destroy: () => void
 }
 
 export type Tagging3DProps = {