vue调用api报错找不到函数.

vue调用api报错找不到函数.
报错信息;
App running at:
WARNING Compiled with 1 warning 12:22:33

warning in ./src/App.vue?vue&type=script&lang=js&

export 'default' (imported as 'creatsingle1') was not found in '@/api/createsingle' (possible exports: creatsingle1)

img


调用:

img

img


js:

img

引入的时候加上花括号 import { xxx } from '@/api/xxx'

因为 你 js 不是export default 所以你引入 就得用 楼上这种方法

也可以在api那个js文件后面添加
export default creatsingle1
把方法名抛出就行了