vue文件說明
1、main.js是我們的入口文件,主要作用是初始化vue實例,並使用我們需要的插件
import Vue from 'vue'
import App from './App'
import router from './router'
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
2、App.vue是我們的跟組件,所有頁面都是在App.vue下面進行切換的,可以理解爲所有的組件都是App.vue的子組件,我們可以吧頭部課底部及每個頁面都出現的內容放在App.vue裏面。
<template>
<div id="app">
<img src="./assets/logo.png">
<hello></hello>
</div>
</template>
<script>
import Hello from './components/Hello'
export default {
name: 'app',
components: {
Hello
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
3、index.html文件入口
4、src放置組件和入口文件
5、node_modules爲依賴的模塊
6、config中配置了路徑端口值等
7、build中配置了webpack的基本配置、開發環境配置、生產環境配置等