Skip to content

Commit

Permalink
fix: render atoms after change slide
Browse files Browse the repository at this point in the history
  • Loading branch information
devlzl committed Jan 9, 2024
1 parent 44bde16 commit 284f23a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/RichText/RichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ onMounted(() => {
})
const rows = ref([] as Array<Array<TextAtom>>)
textStore.events.update.on(({ newAtoms }) => {
const renderAtoms = (newAtoms: TextAtom[]) => {
rows.value = []
let currentRow: Array<TextAtom> = []
rows.value.push(currentRow)
Expand All @@ -30,7 +30,11 @@ textStore.events.update.on(({ newAtoms }) => {
rows.value.push(currentRow)
}
})
}
onMounted(() => {
renderAtoms(textStore.atoms)
})
textStore.events.update.on(({ newAtoms }) => renderAtoms(newAtoms))
history.events.update.on((eventType) => {
if (eventType === 'undo' || eventType === 'redo') {
Expand Down

0 comments on commit 284f23a

Please sign in to comment.