-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vue-3): on editor destruction, transition smoothly (#5772)
- Loading branch information
Showing
9 changed files
with
98 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/vue-3": patch | ||
--- | ||
|
||
Fix editor destruction before transition end if editor is nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div> | ||
<EditorContent :editor="editor" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import StarterKit from '@tiptap/starter-kit' | ||
import { EditorContent, useEditor } from '@tiptap/vue-3' | ||
import { ref } from 'vue' | ||
import VueComponent from './Extension.js' | ||
import type { TNote } from './types.js' | ||
const note = ref<TNote>({ | ||
id: 'note-1', | ||
content: ` | ||
<p>Some random note text</p> | ||
<vue-component count="0"></vue-component> | ||
`, | ||
}) | ||
const editor = useEditor({ | ||
content: note.value.content, | ||
editorProps: { | ||
attributes: { | ||
class: 'textarea', | ||
}, | ||
}, | ||
extensions: [ | ||
StarterKit, | ||
VueComponent, | ||
], | ||
}) | ||
</script> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,6 @@ export const EditorContent = defineComponent({ | |
|
||
editor.createNodeViews() | ||
}) | ||
|
||
} | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters