Add ui for note editing
This commit is contained in:
parent
cb175d3f65
commit
1101305ffb
6 changed files with 138 additions and 2 deletions
31
src/components/user_note/user_note.js
Normal file
31
src/components/user_note/user_note.js
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue