vuejs typescript mapactions

Solutions on MaxInterview for vuejs typescript mapactions by the best coders in the world

showing results for - "vuejs typescript mapactions"
Matteo
25 Jan 2019
1import { Action } from 'vuex-class'
2
3@Component()
4export default class UsersAdd extends Vue {
5  userName: string = "";
6
7  @Action('newUser')
8  newUser!: (newUser: string) => void
9  addUser() {
10    console.log("...adding new user");
11    this.newUser(this.userName);
12  }
13}