//? 安裝谷歌vue開(kāi)發(fā)者工具插件
http://www.jb51.net/article/118557.htm
//? 使用命令行
http://blog.csdn.net/sangjinchao/article/details/58064767
# 全局安裝 vue-cli
$ npm install --global vue-cli
# 創(chuàng)建一個(gè)基于 webpack 模板的新項(xiàng)目
$ vue init webpack my-project
# 安裝依賴甘耿,走你
$cdmy-project
$ npm install
$ npm run dev
如果瀏覽器打開(kāi)之后呕屎,沒(méi)有加載出頁(yè)面境蜕,說(shuō)明本地的8080 端口被占用,需要修改一下配置文件config/index.js
解釋:1.將 build 的路徑前綴修改為 ' ./ '(原本為 ' / ')悴能,是因?yàn)榇虬螅獠恳?js 和 css 文件時(shí),如果路
徑以 ' / ' 開(kāi)頭宝剖,那么在本地是無(wú)法找到對(duì)應(yīng)文件病袄。所以如果需要在本地打開(kāi)打包后的文件搂赋,
就得修改文件路徑。
2.將端口號(hào)改為不常用的端口益缠。
2.引入elementUI.js
1.打開(kāi)cmd脑奠,在當(dāng)前目錄中運(yùn)行:npm i element-ui -S
2.src/main.js(紅色的)
// 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-default/index.css'
Vue.config.productionTip = false
/* eslint-disable no-new */
Vue.use(ElementUI)
new Vue({
el: '#app',
router,
template: '',
components: { App }
})
3.然后在.vue文件里就直接可以用了
例如:在src/components/Hello.vue做一下修改