绑定元素“seriesName”隐式具有“any”类型
const book = {
...
actions: {
mergeBook({ state, commit }, data: any) {
return axios.patch(`/books/merge`, data)
.then((res: any) => {
return res;
});
}
},
};
在typescript的编译过程中,函数的参数被提示 {变量名} implicitly has an ‘any’ type,但是笔者也不知道应该指明他为什么类型的参数。
mergeBook({ state, commit }: { state: any, commit: any }, data: any) {
...
}
第二种解决方法简单粗暴,直接关闭这个校验规则:tsconfig.json 中 添加"noImplicitAny": false,


浙公网安备 33010602011771号