1.html
<head>
<meta charset="UTF-8" />
<!-- Import Vue 3 -->
<script src="//unpkg.com/vue@3.3.4"></script>
<!-- Import style -->
<link rel="stylesheet" href="//unpkg.com/element-plus@2.3.4/dist/index.css" />
<!-- Import component library -->
<script src="//unpkg.com/element-plus@2.3.4"></script>
</head>
2.main.js
app.use(ElementPlus);
3.axios.js
// 这个要怎么搞?我axios里面用了这个组件。
import { ElMessage } from 'element-plus';
你得在vite.config.js文件中配置element-plus
然后在main.js中去import