performace and importing components/plugins
-
Hello,
The common way to add Quasar components to be available globally in the project is:
return { framework: { components: [ 'QTooltip' ] } }
However, some Quasar components maybe used on just one of my project pages in just one child component among multiple others. I import such rarely used Quasar components locally into that child component with:
import { QTooltip } from 'quasar'
and
components: { QTooltip }
which adds just a little bit more code. Is this approach correct and does it improve performance and memory consumption?
Thank you! -
Yes, that is the correct way to go about it.
Also, if you use the component without the import and have the auto-import feature turned on, you don’t need to add the component to the
framework.components
property.https://quasar.dev/quasar-cli/quasar-conf-js#Auto-import-feature
Scott
-
Moving to Auto import works, BUT only of import.quasar.js file generated in the .quasar folder is DELETED manually.