mirror of
https://github.com/amir20/dozzle.git
synced 2026-06-23 04:10:12 +00:00
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
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
566 B
TypeScript
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();
|
|
});
|
|
}
|