import Vue from 'vue'
import Router from 'vue-router'
// 引用模板
import index from '../page/index.vue'
import content from '../page/content.vue'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',component: index
},{
path: '/content'配置main.js
import Vue from 'vue'
import App from './App'
import router from './router/routes.js'
Vue.config.productionTip = false
Vue({
el: '#app'
div id="app">
class="nav-list">
router-link ="nav-item" to="/">首页router-link="/content">内容页router-view></>
script>
export default {
name: 'app
}
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;
}
>
{
test: /\.(js|vue)$/'pre')],options: {
formatter: require('eslint-friendly-formatter')
}
}
style lang="scss"
@import "./style/style";
>
ERROR in ./src/App.vue
Module not found: Error: Can't resolve 'sass-loader' in 'D:\vue_test_project\vuedemo\src'
@ ./src/App.vue 4:2-324
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
npm install sass-loader -D
npm install node-sass -D