📜  vuejs typescript mapactions - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:29.358000             🧑  作者: Mango

代码示例1
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);
  }
}