本人刚学JavaScript和VueJs,看Vue官方的Demo发现这样的写法有点吃力,想请教大家这行代码什么含义,或者帮我找个教程我自己学学也行,我不知道这是JS的语法还是ES6什么的新语法,新东东太多太杂。constcreateListView=id=>()=>import('../views/CreateListView').then(m=>m.default(id))来自(第7行):https://github.com/vuejs/vue-...完整代码:importVuefrom'vue'importRouterfrom'vue-router'Vue.use(Router)//route-levelcodesplittingconstcreateListView=id=>()=>import('../views/CreateListView').then(m=>m.default(id))constItemView=()=>import('../views/ItemView.vue')constUserView=()=>import('../views/UserView.vue')exportfunctioncreateRouter(){returnnewRouter({mode:'history',scrollBehavior:()=>({y:0}),routes:[{path:'/top/:page(\\d+)?',component:createListView('top')},{path:'/new/:page(\\d+)?',component:createListView('new')},{path:'/show/:page(\\d+)?',component:createListView('show')},{path:'/ask/:page(\\d+)?',component:createListView('ask')},{path:'/job/:page(\\d+)?',component:createListView('job')},{path:'/item/:id(\\d+)',component:ItemView},{path:'/user/:id',component:UserView},{path:'/',redirect:'/top'}]})}
德玛西亚99
蛊毒传说
相关分类