Non-lazy loading mode:

import Home from '@/views/home.vue'
{
  path: '/home'.name: 'home'.component: Home
},
Copy the code

A:Resolve is the promise’s resolve callback, called after the component loads successfully

{
  path: '/home'.name: 'home'.component: resolve= > require(['@/views/home.vue'],resolve);
},
Copy the code

Method 2:

{
  path: '/home'.name: 'home'.component: import('@/views/home.vue');
},
Copy the code

The difference between method one and method two

Import is officially provided by ES6

Require is provided by Webpack