diff options
Diffstat (limited to 'src/components/user_note/user_note.js')
| -rw-r--r-- | src/components/user_note/user_note.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/components/user_note/user_note.js b/src/components/user_note/user_note.js new file mode 100644 index 00000000..6a479800 --- /dev/null +++ b/src/components/user_note/user_note.js @@ -0,0 +1,31 @@ +const UserNote = { + props: { + user: Object, + relationship: Object + }, + data () { + return { + localNote: '', + editing: false + } + }, + computed: { + shouldShow () { + return this.relationship.note || this.editing + } + }, + methods: { + startEditing () { + this.localNote = this.relationship.note + this.editing = true + }, + cancelEditing () { + this.editing = false + }, + finalizeEditing () { + this.editing = false + } + } +} + +export default UserNote |
