Vue3在使用element-ui的时候,有时候会报错,这时如何解决呢?
国外站点:
Element Plus - The world's most popular Vue 3 UI framework
1、快速开始 | Element Plus (gitee.io)
参考文章:
【vue】vue3使用element ui_vue3 elementui-CSDN博客
2、先下载包:
npm install element-plus --save
完整引入:
3、package.json有element-plus就证明了可以使用了
4、代码: 可以对其中代码进行增删
import { createApp } from "vue"; import App from "./App.vue"; import router from "./router"; import store from "./store"; import ElementPlus from 'element-plus'; import 'element-plus/theme-chalk/index.css'; import locale from 'element-plus/lib/locale/lang/zh-cn' createApp(App).use(store).use(router).use(scroll).use(ElementPlus, { locale }).mount("#app");
5、
<el-row class="mb-4"> <el-button>Default</el-button> <el-button type="primary">Primary</el-button> <el-button type="success">Success</el-button> <el-button type="info">Info</el-button> <el-button type="warning">Warning</el-button> <el-button type="danger">Danger</el-button> </el-row>