Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select add icon props #5477

Closed
wants to merge 2 commits into from
Closed

Select add icon props #5477

wants to merge 2 commits into from

Conversation

mudin
Copy link

@mudin mudin commented Mar 21, 2019

Hello, it would be really nice to add icon to Select like Tab
icon and selected value/placeholder.

<Select
    size="small" style="width:auto;"
    v-model="privacyKey"
    @on-change="onPrivacySelect"
    :icon="privacy.icon">
    <Option v-for="(item,key) in privacyList"
        :value="item.value"
        label=" "
        :key="item.value">
        <div slot>
            <Icon :type="item.icon" />
            <strong>{{ item.name }}</strong>
            <p style="margin:5px 0 0 16px">{{item.desc}}</p>
        </div>
    </Option>
</Select>

.......

methods:{
   onPrivacySelect(key) {
      this.privacy = this.privacyList[key];
   }
}

Screen Shot 2019-03-21 at 4 23 44 PM

@icarusion icarusion closed this in 2739fc2 Apr 8, 2019
@icarusion
Copy link
Contributor

Use prop and slot prefix instead of icon, more powerful.
Thanks for your pr 👍

@mudin
Copy link
Author

mudin commented Apr 8, 2019

@icarusion Wow this is magic! Thank you too for accepting my pr and correcting me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants