lazy loading in vue code example
Example 1: vue js lazy load component
const Foo = () => import('./Foo.vue')
const router = new VueRouter({
routes: [{ path: '/foo', component: Foo }]
})
Example 2: Lazy Loading Routes vue
routes: [
{
path: '/vue_films-app',
name: 'Movies',
component: Movies,
},
{
path: '/vue_films-app/details/:id',
name: 'Details',
component: () => import('../views/Details.vue'),
},
],
Example 3: lazy loading by scroll vue
npm i vue-infinite-loading