From e2732e8fabe61ccd46d73bbd7b474a0d4e832b92 Mon Sep 17 00:00:00 2001 From: wuyize Date: Fri, 8 Jul 2022 16:52:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3run=20build=E5=90=8EHome?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A4=B4=E9=83=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home.vue | 27 ++++++++--- src/views/ProjectGroup.vue | 91 ++++++++++++++++++++------------------ 2 files changed, 69 insertions(+), 49 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index e24184b..8709a42 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -28,15 +28,17 @@ display: flex; flex-direction: row-reverse; align-items: center">
- {{ this.$store.state.staff===null? this.$store.state.staff:this.$store.state.staff.staffFullname[0] }} + {{ + getStaffFullname()[0] + }}
- {{ this.$store.state.staff===null? this.$store.state.staff: this.$store.state.staff.staffFullname }} + {{ getStaffFullname() }} {{ - this.$store.state.staff===null? this.$store.state.staff:this.$store.state.staff.staffUsername + getStaffUsername() }}
@@ -66,13 +68,25 @@ export default { name: 'Home', components: {}, data() { - return { - - } + return {} }, mounted() { }, + methods: { + getStaffFullname() { + if(this.$store&&this.$store.state.staff) + return this.$store.state.staff.staffFullname + else + return ' ' + }, + getStaffUsername() { + if(this.$store&&this.$store.state.staff) + return this.$store.state.staff.staffUsername + else + return ' ' + }, + } } @@ -86,5 +100,4 @@ export default { } - \ No newline at end of file diff --git a/src/views/ProjectGroup.vue b/src/views/ProjectGroup.vue index eee7a51..ae618a9 100644 --- a/src/views/ProjectGroup.vue +++ b/src/views/ProjectGroup.vue @@ -1,22 +1,23 @@