Improve login/logout

Extract mutation types to mutation-types.js
This commit is contained in:
2022-01-25 20:30:47 +00:00
parent 6dcf7da861
commit 74c4c7cb02
5 changed files with 35 additions and 15 deletions

View File

@ -1,5 +1,8 @@
<script>
// This starter template is using Vue 3 <script setup> SFCs
import { LOGOUT } from "./store/mutation-types";
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
export default {
data() {
@ -14,7 +17,8 @@ export default {
},
methods: {
logout () {
this.$store.dispatch("logout");
this.$store.commit(LOGOUT);
this.$router.push("/login")
},
toggleMenu () {
this.showMenu = !this.showMenu;