Files
medium-aws-tutorial-1/src/views/Home.vue
2020-03-16 02:41:30 +00:00

29 lines
480 B
Vue

<template>
<div>
<h1>Hello {{ this.currentUser }}</h1>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
async mounted() {
await this.$store.dispatch("fetchUser");
},
computed: {
...mapGetters({ currentUser: "userEmail" })
},
methods: {
getUser() {
try {
return this.$store.getters.userEmail;
} catch (TypeError) {
// pass}
}
}
}
};
</script>
<style lang="scss" scoped></style>