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 @@