Files
dozzle/assets/composable/useExprEditorField.ts
Amir Raminfar 2975a9ceda
Push container / Push branches and PRs (push) Has been cancelled
Deploy VitePress site to Pages / build (push) Has been cancelled
Deploy VitePress site to Pages / Deploy (push) Has been cancelled
Test / Typecheck (push) Has been cancelled
Test / JavaScript Tests (push) Has been cancelled
Test / Go Tests (push) Has been cancelled
Test / Go Staticcheck (push) Has been cancelled
Test / Integration Tests (push) Has been cancelled
feat: add Docker event notifications (#4556)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:00:20 +00:00

24 lines
566 B
TypeScript

import { createExprEditor } from "@/composable/exprEditor";
type ExprEditorOptions = Parameters<typeof createExprEditor>[0];
export function useExprEditorField(
editorRef: Ref<HTMLElement | undefined>,
options: Omit<ExprEditorOptions, "parent">,
) {
let editorView: Awaited<ReturnType<typeof createExprEditor>> | undefined;
onMounted(async () => {
if (editorRef.value) {
editorView = await createExprEditor({
parent: editorRef.value,
...options,
});
}
});
onScopeDispose(() => {
editorView?.destroy();
});
}