<repo_name>jhsziit/wechat<file_sep>/src/router/index.js
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      component: r => require.ensure([], () => r(require('../pages/index'))),
      children: [{
        path: '',
        redirect: {
          name: 'chat'
        }
      },
      {
        path: 'chat',
        name: 'chat',
        meta: {
          title: '微信'
        },
        component: r => require.ensure([], () => r(require('../pages/chat/chat')))
      },
      {
        path: 'contact',
        name: 'contact',
        meta: {
          title: '联系人'
        },
        component: r => require.ensure([], () => r(require('../pages/contact/contact')))
      },
      {
        path: 'find',
        name: 'find',
        meta: {
          title: '发现'
        },
        component: r => require.ensure([], () => r(require('../pages/find/find')))
      },
      {
        path: 'me',
        name: 'me',
        meta: {
          title: '我'
        },
        component: r => require.ensure([], () => r(require('../pages/me/me')))
      }
      ]
    },
    {
      path: '/new-friends',
      name: 'new-friends',
      meta: {
        title: '新的朋友'
      },
      component: r => require.ensure([], () => r(require('../pages/contact/new-friends')))
    },
    {
      path: '/personal-details',
      name: 'personal-details',
      meta: {
        title: '个人详情'
      },
      component: r => require.ensure([], () => r(require('../pages/contact/personal-details')))
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})

export default router
<file_sep>/src/store/mutations-type.js
export const SET_HEAD_TITLE = 'SET_HEAD_TITLE'
export const GET_WECHAT_LIST = 'GET_WECHAT_LIST'
<file_sep>/src/store/mutations.js
import {
  SET_HEAD_TITLE,
  GET_WECHAT_LIST
} from './mutations-type'
export default {
  // 底部导航修改头部标题
  [SET_HEAD_TITLE] (state, index) {
    // state.headTitle = state.appNavs[index].text;
  },
  [GET_WECHAT_LIST] (state, list) {
    state.wechatList = list
    console.log(state.wechatList)
  },
}
<file_sep>/src/store/state.js
export default {
  // wechat列表
  wechatList: {}
}
