Element Plus FAQ
This page lists common issues and solutions when using Element Plus.
Installation Issues
Installation Failed
Symptoms: npm install or yarn add fails
Solutions:
- Check Node.js version, ensure >= 14.0.0
- Clear npm cache:
npm cache clean --force - Delete node_modules and package-lock.json, then reinstall
TypeScript Type Errors
Symptoms: Type errors when importing components
Solutions:
- Make sure Volar plugin is installed
- Add to tsconfig.json:
{ "compilerOptions": { "types": ["element-plus/global"] } }
Usage Issues
Component Styles Not Applied
Symptoms: Component styles don't match expectations
Solutions:
- Make sure CSS is correctly imported:
import 'element-plus/dist/index.css' - Check for global style overrides
Icons Not Displayed
Symptoms: Icon components show blank or squares
Solutions:
Install icon library:
npm install @element-plus/icons-vueRegister icons globally:
import * as icons from '@element-plus/icons-vue' for (const [key, component] of Object.entries(icons)) { app.component(key, component) }
On-Demand Import Not Working
Symptoms: Bundle size still large
Solutions:
- Check if plugin configuration is correct
- Ensure correct resolver is used
Internationalization Not Working
Symptoms: Component text doesn't change after language switch
Solutions:
- Import language pack correctly:
import en from 'element-plus/es/locale/lang/en' - Configure locale:
app.use(ElementPlus, { locale: en })
Component Issues
Table Issues
Table Sorting Not Working
Make sure prop attribute is set:
<el-table-column prop="date" sortable />
Table Fixed Columns Misaligned
Make sure table has fixed height:
<el-table :data="data" height="300" />
Form Issues
Form Validation Not Triggering
Make sure el-form-item has prop attribute:
<el-form-item label="Name" prop="name">
<el-input v-model="ruleForm.name" />
</el-form-item>
Dialog Issues
Dialog Scrolling Issues
When dialog content is too long, make sure to add scrolling:
<el-dialog>
<div style="max-height: 60vh; overflow-y: auto;">
<!-- Content -->
</div>
</el-dialog>
Style Issues
Style Conflicts
Symptoms: Custom styles are overridden
Solutions:
- Use more specific selectors
- Use ::v-deep or :deep()
Theme Color Not Applied
Check if CSS variables are correctly overridden:
:root {
--el-color-primary: #409eff;
}
Make sure it's loaded after element-plus styles.
Performance Issues
Page Lag
For large datasets:
- Use el-table-v2 (virtual table)
- Use pagination to load data
- Avoid complex components in tables
Bundle Size Too Large
- Use on-demand import
- Remove unused plugins
Vue Version Issues
Not Compatible with Vue 2
Element Plus only supports Vue 3. If you need Vue 2, use Element UI.
Composition API Not Supported
Make sure to use Vue 3.2+ for better Composition API support.
Getting Help
- GitHub Issues: https://github.com/element-plus/element-plus/issues
- Official Discord: https://discord.com/invite/element-plus
