강의

멘토링

로드맵

Inflearn Community Q&A

hanmomhanda0763's profile image
hanmomhanda0763

asked

TypeScript with Vue Practical Project

Using vuex-class

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

Written on

·

223

0

@Action private readonly decrease;

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

vuejs

Answer 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's profile image
hanmomhanda0763

asked

Ask a question