forked from nextcloud/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotesList.vue
More file actions
47 lines (42 loc) · 693 Bytes
/
NotesList.vue
File metadata and controls
47 lines (42 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<ul>
<NoteItem v-for="note in notes"
:key="note.id"
:note="note"
:renaming="isRenaming(note.id)"
@note-selected="onNoteSelected"
@start-renaming="onStartRenaming"
/>
</ul>
</template>
<script>
import NoteItem from './NoteItem.vue'
export default {
name: 'NotesList',
components: {
NoteItem,
},
props: {
notes: {
type: Array,
required: true,
},
},
data() {
return {
renamingNotes: [],
}
},
methods: {
onNoteSelected(noteId) {
this.$emit('note-selected', noteId)
},
onStartRenaming(noteId) {
this.renamingNotes.push(noteId)
},
isRenaming(noteId) {
return this.renamingNotes.includes(noteId)
},
},
}
</script>