Skip to content

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 ​

ParameterTypeDescription
getEditor() => Editor | null | undefinedFunction that returns the editor instance
optionsVizelCommentOptionsComment configuration options

Returns ​

UseVizelCommentResult

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>

Released under the MIT License.