Vizel API / vue/src / useVizelComment
Function: useVizelComment()
ts
function useVizelComment(getEditor, options?): UseVizelCommentResult;Defined in: packages/vue/src/composables/useVizelComment.ts:64
Composable for managing document comments and annotations.
Parameters
| Parameter | Type | Description |
|---|---|---|
getEditor | () => Editor | null | undefined | Function that returns the editor instance |
options | VizelCommentOptions | Comment configuration options |
Returns
Comment state and controls
Example
vue
<script setup lang="ts">
import { useVizelEditor, useVizelComment } from "@vizel/vue";
const editor = useVizelEditor({ features: { collaboration: { comments: true } } });
const { comments, addComment, resolveComment, setActiveComment } =
useVizelComment(() => editor.value, { key: "my-comments" });
</script>