강의

멘토링

로드맵

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của hanmomhanda0763
hanmomhanda0763

câu hỏi đã được viết

Dự án thực tế với Typescript và Vue

Sử dụng vuex-class

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

Viết

·

223

0

@Action private readonly decrease;

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

vuejs

Câu trả lời 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;
}
Hình ảnh hồ sơ của hanmomhanda0763
hanmomhanda0763

câu hỏi đã được viết

Đặt câu hỏi