You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
470 B

import { watch } from "vue-demi";
import { ToolInstances } from "../types";
import { Props } from "./";
export function useWatch({ props, instances }: { props: Props; instances: ToolInstances }) {
watch(
() => props.markTool?.icon,
val => {
if (!val) return;
if (typeof val === "string") {
instances.markTool?.setPointImage(val);
} else {
val?.iconUrl && instances.markTool?.setPointImage(val?.iconUrl);
}
}
);
}