Improve login/logout
Extract mutation types to mutation-types.js
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user