123456789 |
- import { inject, provide, Ref } from 'vue'
- import { DrawExpose } from "@/index.ts";
- const actionKey = Symbol('drawAction');
- export const installDraw = (drawRef: Ref<DrawExpose | undefined>) => {
- provide(actionKey, drawRef)
- }
- export const useDraw = () => inject<Ref<DrawExpose | undefined>>(actionKey)!
|