dum3ng / study-issues

0 stars 0 forks source link

dynamically import component in vue using webpack #13

Open dum3ng opened 5 years ago

dum3ng commented 5 years ago

The import is a function which return a promise. so we can do stuff after the dynamic component is loaded.

import('some/component')
  .then(()=> console.log('component loaded') )

Also we can use meta info in the import to tell webpack to split code to another chunk.

import(/* webpackChunkName: about */ 'path/to/component/or/file')