1.创建项目
使用命令 vue create element-admin(后面这个是项目名称)
以下为我的选择,可以根据个人项目需要来选择。
Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Linter
? Choose a version of Vue.js that you want to start the project with 3.x (Preview)
? Use history mode for router? (Requires proper server setup for index fallback in production) No
? Pick a linter / formatter config: Standard
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
2.安装Element-UI
cd element-admin (进入创建的项目)
vue add element (安装Element-UI)
3.引入Element-UI
main.js的配置:
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App)
}).$mount('#app')
该博客介绍了使用Vue创建项目及安装、引入Element-UI的步骤。先通过命令vue create创建项目,可按需选择配置;接着进入项目目录,用vue add element安装Element-UI;最后介绍了main.js的配置以引入Element-UI。
1537

被折叠的 条评论
为什么被折叠?



