Answers for "vuejs typescript mapactions"

1

vuejs typescript mapactions

import { Action } from 'vuex-class'

@Component()
export default class UsersAdd extends Vue {
  userName: string = "";

  @Action('newUser')
  newUser!: (newUser: string) => void
  addUser() {
    console.log("...adding new user");
    this.newUser(this.userName);
  }
}
Posted by: Guest on December-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language