[Vuejs]-Best practice to import components in VueJS 2.0

0๐Ÿ‘

โœ…

I believe your question is whether to import components globally, in the new Vue({})/main.js page, or locally as needed. Is that correct?

Importing them as needed reduces bundle size, but if you are reusing a component a lot, then maybe import that one globally.

The main consideration for me is whether I need to access info from this.$options.components (which will only return locally registered ones).

๐Ÿ‘คLShapz

0๐Ÿ‘

as of right now the best way to import a Component into vue.js is

import Test from './Test.vue';
๐Ÿ‘คAbslen Char

Leave a comment