Advertisement
Guest User

Untitled

a guest
Jan 25th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { mapState } from 'vuex'
  2.  
  3. export default {
  4.   data () {
  5.     return {
  6.       payload: {
  7.         username: '',
  8.         password: ''
  9.       }
  10.     }
  11.   },
  12.  
  13.   computed: {
  14.     ...mapState({
  15.       user: store => store.services.users.entity
  16.     })
  17.   },
  18.  
  19.   methods: {
  20.     async submit () {
  21.       await this.$store.dispatch('services/users/create', this.payload)
  22.  
  23.       // Log the created user.
  24.       console.log(this.user)
  25.     }
  26.   }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement