import App from '../App'

const index = r => require.ensure([], () => r(require('../views/index')), 'index')
const search = r => require.ensure([], () => r(require('../views/search-index')), 'search')
const result = r => require.ensure([], () => r(require('../views/result')), 'result')

export default [{
    path: '/',
    component: App, //顶层路由，对应index.html
    children: [ //二级路由。对应App.vue
        //地址为空时跳转home页面
        {
            path: '',
            redirect: '/index'
        },
        //首页城市列表页
        {
            path: '/index',
            component: index
        },
        //首页城市列表页
        {
            path: '/search',
            component: search
        },
        //首页城市列表页
        {
            path: '/result',
            component: result
        },
    ]
}]
