carbon-design-system / carbon-components-vue

Vue implementation of the Carbon Design System
http://vue.carbondesignsystem.com
Apache License 2.0
597 stars 176 forks source link

Vue3 - missing (?) named components' exports from the library #1578

Closed OlkaB closed 2 months ago

OlkaB commented 3 months ago

In Vue2 there was an option to import components separately from the library (instead of installing everything) by using a named imports

import { CvButton } from '@carbon/vue';

This way doesn't work in Vue3 anymore. Seems there is only default export of install components plugin. Question: Is this intentional? Is there a change to restore also named exports?

davidnixon commented 3 months ago

I have not tried that and I didn't know that was an option in Vue2. I did know that you could selectively import items like:

app.use(CarbonVue3, ["CvButton", etc]);

But I have not tried that either. That code is here: https://github.com/carbon-design-system/carbon-components-vue/blob/066aac04cd806f22bdb8458032f5b96afb09f5a3/src/index.js#L27-L32

I see this in Vue 2 branch https://github.com/carbon-design-system/carbon-components-vue/blob/c63f589bfc983ab1b46afa8736c5857e68f96cdc/packages/core/src/index.js#L28-L30 ...

I'm sure we could replicate that with a script so that it would be a little more maintainable.