fix wordcount
This commit is contained in:
@@ -10,7 +10,7 @@ export const notes = computed<Note[]>(() => {
|
|||||||
return Object.entries(baseNotes)
|
return Object.entries(baseNotes)
|
||||||
.map(([_, note]) => ({
|
.map(([_, note]) => ({
|
||||||
...note,
|
...note,
|
||||||
wordCount: note.content.split(' ').length - 1,
|
wordCount: note.content.split(' ').filter((word) => word.length > 0).length,
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => b.modified - a.modified) as Note[]
|
.sort((a, b) => b.modified - a.modified) as Note[]
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user