/** * @author 青衿 * @date 2017/6/19 14:53 * @description 获取权限列表数据(获取侧边栏菜单树) */ axios.get('/entryNodes').then((response) => { store.commit('isLogin', true) let menuData = response.data store.commit('menuData', menuData) let routes = [ {path: '/', component: components['Home']} ] generateRoutesFromMenu(menuData, routes, '/') const router = new VueRouter({ routes }) sync(store, router) // 初始化Vue实例 new Vue({ el: '#app', router, store, render: h => h(App) }) }) 我的笨办法,以供参考
我的笨办法,以供参考