Preserve comment text on submission errors

This commit is contained in:
Tim
2025-08-06 19:28:57 +08:00
parent b9819252d3
commit fdf51be5f5
3 changed files with 9 additions and 5 deletions
+5 -3
View File
@@ -67,9 +67,11 @@ export default {
if (!vditorInstance.value || isDisabled.value) return
const value = vditorInstance.value.getValue()
console.debug('CommentEditor submit', value)
emit('submit', value)
vditorInstance.value.setValue('')
text.value = ''
emit('submit', value, () => {
if (!vditorInstance.value) return
vditorInstance.value.setValue('')
text.value = ''
})
}
onMounted(() => {