diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-08-20 13:02:27 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-12-21 23:16:00 -0500 |
| commit | 1101305ffb72bacd68698bfbe6e961953a9043de (patch) | |
| tree | e39252de0c24463b1cee18a4b4e77a9e7c7d953c /src/components/user_note/user_note.js | |
| parent | cb175d3f65ea79acc54949a3e33e926ce1357733 (diff) | |
Add ui for note editing
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 |
