-
-
Save anonymous/4f514a32397d890b0d34ca6fa0baf22e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mapActions } from 'vuex' | |
export default { | |
data() { | |
return { | |
loaging: false, | |
message: null, | |
user: { email: null, passworld: null } | |
} | |
}, | |
methods: { | |
...mapActions(['attemptLogin']) | |
send () { | |
const user = this.user | |
this.loading = true | |
this.message = null | |
this.attemptLogin({ ...user }) | |
.then(() => { | |
this.loading = false | |
this.$router.push('/dashboard') | |
}) | |
.cath(e => { | |
this.message = e.message | |
this.loading = false | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
precisa alterar o nome da propriedade do objeto nessa linha para "loading". :)
obs.: muito bom seu artigo, parabéns!