|
@@ -1,8 +1,10 @@
|
|
|
import { ref } from "vue";
|
|
|
-import { structureDraw } from "../graphic/index.js";
|
|
|
+import type { structureDraw } from "../graphic/index.js";
|
|
|
|
|
|
export const drawRef = ref<ReturnType<typeof structureDraw>>();
|
|
|
|
|
|
-export const setCanvas = (canvas: HTMLCanvasElement) => {
|
|
|
- drawRef.value = structureDraw(canvas);
|
|
|
+export const setCanvas = async (canvas: HTMLCanvasElement) => {
|
|
|
+ await import("../graphic/index.js").then((model) => {
|
|
|
+ drawRef.value = model.structureDraw(canvas);
|
|
|
+ });
|
|
|
};
|