1.安装
// 全局安装vue/cli npm install -g @vue/cli // 更新 vue upgrade --next // 安装项目 npm init vite-app my-app cd my-app npm i npm run dev
2.引入axios
npm install axios -S //main.js 引入 import axios from 'axios'; const app = createApp(App); app.config.globalProperties.$axios = axios; app.mount('#app');
loadsh 同axios