页面运行时报错Uncaught TypeError: (0 , axios__WEBPACK_IMPORTED_MODULE_0__.axios) is not a function
原因:使用了import {axios} from 'axios’引入axios模块,改为import axios from 'axios’后正常
带花括号使用,未将模块全部导入,使用时没有找到axios方法
导入通过export 导出的方法或函数 时,使用花括号:
helloworld.js
export function helloworld(nihao,shijie){
};
==========================================
App.vue
import {helloworld} from "helloworld";
不加花括号:
全部导入
import elephant from ‘./zoo’
通过export方式导出,在导入时要加{ },export default则不需要