carbon-design-system / carbon-components-vue

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

How to populate cv-dropdown component options? #951

Closed DakotaWray2 closed 4 years ago

DakotaWray2 commented 4 years ago

Hi there, Thanks for the great components. I'm currently migrating from Vuetify and wondering if there is a better solution to populating the cv-dropdown-item? It doesn't seem to be in the docs.

What I am doing now. <cv-dropdown-item v-bind:key="option.Id" v-for="option in reportSources" :value="option.Source">{{option.Title}}</cv-dropdown-item> </cv-dropdown>

Thanks!

lee-chase commented 4 years ago

How would you like to populate the cv-dropdown?

I note that the Vuetify select allows items to be passed in, presumably to populate it.

In Carbon Vue we have tried to structure our list and select components more like standard HTML Select/Option.

DakotaWray2 commented 4 years ago

Morning and thanks for the quick response. That is fine, and works for me. I just wanted to make sure it was the correct way according to the devs. Might i suggest an items prop as a future option since some other components use it, multiselect for example, and the React version has the capability as well.

lee-chase commented 4 years ago

It would be relatively trivial to add if you fancy submitting a PR.

Your usages look correct given the current API.

DakotaWray2 commented 4 years ago

I will try to knock it out this week.

DakotaWray2 commented 4 years ago

979