Vue前端篇(二)引进ElementUI
程序员文章站
2024-03-24 09:08:16
...
首先在IDEA中安装Vue插件:打开Settings...
选择Plugins,输入Vue,点击install下载
打开命令端(使用Yarn命令):输入yarn add element-ui
main.js引入ElementUI
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.config.productionTip = false
Vue.use(ElementUI);
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App)
// components: { App },
// template: '<App/>'
})
测试一下:在component下的HelloWorld中添加个<el-button>按钮
访问http://localhost:8081/#/