small improvement
This commit is contained in:
@@ -62,7 +62,10 @@ const references = computed<Note[]>(() => {
|
|||||||
</div>
|
</div>
|
||||||
<hr class="my-3" />
|
<hr class="my-3" />
|
||||||
<div class="flex text-sm text-secondary">
|
<div class="flex text-sm text-secondary">
|
||||||
<span>{{ note.wordCount }} words</span>
|
<span
|
||||||
|
>{{ note.wordCount }}
|
||||||
|
{{ note.wordCount === 1 ? 'word' : 'words' }}</span
|
||||||
|
>
|
||||||
<span class="ml-auto">Last modified {{ formatDate(note.modified) }}</span>
|
<span class="ml-auto">Last modified {{ formatDate(note.modified) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,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,
|
wordCount: note.content.split(' ').length - 1,
|
||||||
}))
|
}))
|
||||||
.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