关于 import xhr from './xhr'
来源:4-6 编写基础请求代码 - 利用 XMLHttpRequest 发送请求

慕莱坞0998854
2019-07-01
老师在index.ts中的代码如下:
import { AxiosRequestConfig } from './types'
import xhr from './xhr'
请问下这里为什么不写成 import { xhr } from ‘./xhr’ ?是因为xhr.ts中导出的是函数还是因为xhr.ts只导出了一个东西?
写回答
1回答
-
因为 xhr.js 用的是 export default
132019-07-02
相似问题