(history) count notes

This commit is contained in:
Julien Calixte
2021-08-08 00:27:15 +02:00
parent b3ffb56428
commit e4a2d4d8de
2 changed files with 7 additions and 7 deletions

View File

@@ -4,11 +4,9 @@ import { computed } from 'vue'
export const useNotes = () => { export const useNotes = () => {
const store = useUserRepoStore() const store = useUserRepoStore()
const notes = computed(() => { const notes = computed(() =>
console.log(store.files) store.files.filter((file) => file.path?.endsWith('.md'))
)
return store.files
})
return { return {
notes notes

View File

@@ -7,7 +7,9 @@
:with-content="false" :with-content="false"
> >
<h3 class="subtitle is-3">History</h3> <h3 class="subtitle is-3">History</h3>
{{ notes }} There are {{ notes.length }} notes
<pre>{{ notes }}</pre>
</flux-note> </flux-note>
</div> </div>
</template> </template>
@@ -28,7 +30,7 @@ export default defineComponent({
repo: { type: String, required: true } repo: { type: String, required: true }
}, },
setup() { setup() {
const notes = useNotes() const { notes } = useNotes()
return { notes } return { notes }
} }