Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2016 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4f514a32397d890b0d34ca6fa0baf22e to your computer and use it in GitHub Desktop.
Save anonymous/4f514a32397d890b0d34ca6fa0baf22e to your computer and use it in GitHub Desktop.
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
})
}
}
}
@tcelestino
Copy link

precisa alterar o nome da propriedade do objeto nessa linha para "loading". :)

obs.: muito bom seu artigo, parabéns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment