element+plus安装
时间: 2023-12-01 22:41:03 浏览: 74
element-plus
以下是安装 Element Plus 的步骤:
1.使用 npm 安装 Element Plus:
```shell
npm install element-plus --save
```
2.在 main.js 中引入 Element Plus:
```javascript
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
import App from './App.vue'
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
```
3.在组件中使用 Element Plus 的组件:
```vue
<template>
<el-button>Click me</el-button>
</template>
<script>
import { defineComponent } from 'vue'
export default defineComponent({
name: 'MyComponent'
})
</script>
```
阅读全文