From 68eb04c1379aca5e15ce18b140a160827f2985c9 Mon Sep 17 00:00:00 2001 From: Matthew Aaron Raymer Date: Tue, 17 Jan 2023 16:53:44 +0800 Subject: [PATCH] Added updating account name --- src/views/AccountViewView.vue | 10 +++++++++- src/views/NewEditAccountView.vue | 28 +++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index e22bb03..0bc56fa 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -72,7 +72,7 @@
-

Firstname Lastname

+

{{ firstName }} {{ lastName }}

ID
@@ -36,6 +39,7 @@ @@ -50,5 +54,27 @@ import { Options, Vue } from "vue-class-component"; @Options({ components: {}, }) -export default class NewEditAccountView extends Vue {} +export default class NewEditAccountView extends Vue { + firstName = + localStorage.getItem("firstName") === null + ? "--" + : localStorage.getItem("firstName"); + lastName = + localStorage.getItem("lastName") === null + ? "--" + : localStorage.getItem("lastName"); + + onClickSaveChanges() { + localStorage.setItem("firstName", this.firstName as string); + localStorage.setItem("lastName", this.lastName as string); + const route = { + name: "account", + }; + this.$router.push(route); + } + + onClickCancel() { + this.$router.back(); + } +}