/
NoteList.vue
67 lines (62 loc) 路 1.28 KB
/
NoteList.vue
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<div>
<div class="notelist-wrap">
<h3 class="block-title">
{{ $t('NOTES.HEADER.TITLE') }}
</h3>
<add-note @add="onAddNote" />
<contact-note
v-for="note in notes"
:id="note.id"
:key="note.id"
:note="note.content"
:user-name="note.user.name"
:time-stamp="note.created_at"
:thumbnail="note.user.thumbnail"
@edit="onEditNote"
@delete="onDeleteNote"
/>
<div class="button-wrap">
<woot-button variant="link" @click="onclick">
{{ $t('NOTES.FOOTER.BUTTON') }}
<i class="ion-arrow-right-c" />
</woot-button>
</div>
</div>
</div>
</template>
<script>
import ContactNote from './ContactNote';
import AddNote from './AddNote';
export default {
components: {
ContactNote,
AddNote,
},
props: {
notes: {
type: Array,
default: () => [],
},
},
methods: {
onclick() {
this.$emit('show');
},
onAddNote(value) {
this.$emit('add', value);
},
onEditNote(value) {
this.$emit('edit', value);
},
onDeleteNote(value) {
this.$emit('delete', value);
},
},
};
</script>
<style lang="scss" scoped>
.button-wrap {
margin-top: var(--space-one);
}
</style>