|
@@ -16,6 +16,8 @@ import { DC } from "@/deconstruction.js";
|
|
|
import { Transform } from "konva/lib/Util";
|
|
|
import { useViewerInvertTransform, useViewSize } from "@/core/hook/use-viewer.ts";
|
|
|
import { getFixPosition } from "@/utils/bound.ts";
|
|
|
+import { useStore } from "@/core/store/index.ts";
|
|
|
+import { useHistory } from "@/core/hook/use-history.ts";
|
|
|
|
|
|
const props = defineProps<{ data: IconData; addMode?: boolean }>();
|
|
|
const svg = ref<SVGParseResult | null>(null);
|
|
@@ -28,6 +30,8 @@ defineExpose({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
+const store = useStore();
|
|
|
+const history = useHistory();
|
|
|
watch(
|
|
|
() => data.value.url,
|
|
|
async (url) => {
|
|
@@ -38,6 +42,7 @@ watch(
|
|
|
if (content.paths.length === 0) {
|
|
|
svg.value = null;
|
|
|
console.error(props.data.url, content, "路径数据不正确不是svg");
|
|
|
+ history.preventTrack(() => store.delItem("icon", props.data.id));
|
|
|
} else {
|
|
|
svg.value = content;
|
|
|
}
|