import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'HelloWorld',
component: reslove => {require(['@/components/HelloWorld'],reslove)},
meta: {//是否保持状态
keepAlive: true
}
}
]
})
在vue-cli下的router文件夹下的index.js中的配置