Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { mapState } from 'vuex'
- export default {
- data () {
- return {
- payload: {
- username: '',
- password: ''
- }
- }
- },
- computed: {
- ...mapState({
- user: store => store.services.users.entity
- })
- },
- methods: {
- async submit () {
- await this.$store.dispatch('services/users/create', this.payload)
- // Log the created user.
- console.log(this.user)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement