1.0.4 • Published 2 years ago

vben-simple-axios v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

使用

// http.ts
import { VAxios } from 'vben-simple-axios'

interface RequestOptions {}

interface Result<T = any> {}

export const http = new VAxios<RequestOptions, Result>({
  transform: {
    // 见axiosTransform.ts
  },
  requestOptions: {
    // 默认的RequestOptions,可以被覆盖
  },
  // axios配置...
})


// api.ts
import { http } from 'http.ts'
export const testApi = (data) => {
  return http.post({
    url: 'xxx',
    data
  }, {
    // RequestOptions
  })
}
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago