错误: useId() 在 Vue 节点视图中发生冲突,因为 editor.appContext 是浅拷贝,而不是共享引用
作者: teo-basili创建于 2026年9月7日更新于 2026年9月7日
标签area: vuecomplexity: mediumimpact: low
useId() → {{ id }}
```vue
<!-- PlainIdBlock.vue -- control group: identical useId() call, but NOT a node view -->
<template>
<div class="id-block">useId() → <strong>{{ id }}</strong></div>
</template>
<script setup>
import { useId } from 'vue'
const id = useId()
console.log('useId() (plain sibling) ->', id)
</script><!-- App.vue -->
<template>
<!-- Control group: two ordinary sibling components, no Tiptap involved -->
<PlainIdBlock />
<PlainIdBlock />
<!-- Bug: two Tiptap Vue node views, same component, same editor -->
<EditorContent :editor="editor" />
</template>
<script setup>
import { useEditor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
import { Node, mergeAttributes } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import PlainIdBlock from './PlainIdBlock.vue'
import IdBlockView
…内容来源: ueberdosis/tiptap