강의

멘토링

로드맵

Inflearn コミュニティ Q&A

hanmomhanda0763 のプロフィール画像
hanmomhanda0763

投稿した質問数

TypeScript with Vue 実戦プロジェクト

Vuex Class の使い方

@Action, @Mutation 등으로 지정된 변수의 타입

作成

·

223

0

@Action private readonly decrease;

이렇게 해놓으면 decrease의 타입이 없다는 경고가 나오는데요, 어떻게 하면 경고를 없앨 수 있을까요?

vuejs

回答 1

0

해당 타입을 any로 지정하거나, 'ActionMethod'; 를 지정해 주시면 됩니다.

import { ActionMethod, MutationMethod } from "vuex";
export default class App extends Vue {
@Action readonly increase!: ActionMethod;
@Action readonly decrease!: ActionMethod;
@Mutation readonly setCount!: MutationMethod;
}
hanmomhanda0763 のプロフィール画像
hanmomhanda0763

投稿した質問数

質問する