类型“AxiosResponse<any, any>”上不存在属性“xxx”
ts类型检查类型“AxiosResponse”上不存在属性“xxx”
·
新建axios.d.ts文件
import axios, { Axios, AxiosResponse, AxiosRequestConfig } from 'axios'
declare module 'axios' {
interface AxiosResponse<T = any> {
// 这个地方放属性
message: any
}
export function create(config?: AxiosRequestConfig): AxiosInstance
}
更多推荐
已为社区贡献1条内容
所有评论(0)