从'axios'导入axios;
导致 vite 投掷
示例代码未捕获的语法错误:找不到导入:默认
import { createApp } from 'vue';
import TheContainer from './components/TheContainer.vue';
import axios from 'axios';
axios.defaults.baseURL = process.env.VUE_APP_API_URL;
const app = createApp({
components: {
TheContainer
}
})
app.axios = axios;
app.$http = axios;
app.config.globalProperties.axios = axios;
app.config.globalProperties.$http = axios;
app.mount('#app');
这是使用 axios 0.21.1 和 vue 3.0.5
试图找出问题所在... vuejs v3 cookbook 遗憾地通过 cdn 调用 axios 0.14 代码