# Installation
This section will introduce how to install and configure Element-UI-X in your project.
# Environment Requirements
Tool | Version | Description |
---|---|---|
Node.js | 14.x - 18.x | For Vue2 projects, avoid latest versions, 16.x is safest |
Vue | 2.x | -- |
Element | -- | -- |
npm | -- | -- |
# Installation Methods
# Install using npm
# Install Element UI
npm install element-ui
# Install Element-UI-X
npm install vue-element-ui-x
# Full Import
Import Element UI and Element-UI-X in main.js:
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import ElementUIX from 'vue-element-ui-x';
// Import Element UI
Vue.use(ElementUI);
// Import Element-UI-X
Vue.use(ElementUIX);
new Vue({
el: '#app',
render: h => h(App),
});
The above code completes the import of Element-UI-X. Note that Element-UI-X depends on Element UI, so Element UI must be imported first.
# On-demand Import
If you only want to import some components, you can use on-demand import:
# Manual Import
import Vue from 'vue';
import { ElXTypewriter } from 'vue-element-ui-x';
// Register component
Vue.component(ElXTypewriter.name, ElXTypewriter);
Next, import components on-demand in main.js:
import Vue from 'vue';
import { Button, Select } from 'element-ui';
import { ElXTypewriter } from 'vue-element-ui-x';
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
Vue.component(ElXTypewriter.name, ElXTypewriter);
# Verify Installation
After installation, you can use Element-UI-X components in your components:
Copy
Next, please check the Quick Start section to learn how to use Element-UI-X components.
# Related Links
- Element UI Official Website (opens new window)
- Vue.js Official Website (opens new window)
- Element-UI-X Demo (opens new window)
- Element-UI-X GitHub Repository (opens new window)
- If you're looking for Vue3 version Element-Plus-X, portal here (opens new window)
Next, please check the Installation section to learn how to use Element-UI-X in your project.