npm install -g cnpm --registry=https://registry.npm.taobao.org
npm instsall -g vue-cli
# demo是項目名 vue init webpack demo
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 /* eslint-disable no-new */ Vue.use(ElementUI) new Vue({ el: '#app', router, components: { App }, template: '<App/>' })
<div class="block"> <span class="demonstration">默認顯示顏色</span> <span class="wrapper"> <el-button type="success">成功按鈕</el-button> <el-button type="warning">警告按鈕</el-button> <el-button type="danger">危險按鈕</el-button> <el-button type="info">信息按鈕</el-button> </span> </div> </div>
-- 執行命令 npm run dev,就能夠看到elementUi是否成功css