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

How to custom dropdown? #435

Open
Adikaarif opened this issue Dec 16, 2024 · 3 comments
Open

How to custom dropdown? #435

Adikaarif opened this issue Dec 16, 2024 · 3 comments

Comments

@Adikaarif
Copy link

I want one of my multiselect dropdowns to have a width of 600px, how do I adjust the .multiselect-dropdown class? (this is because my programming knowledge is still shallow)

@rafia9005
Copy link

solution to problem

maybe like this:

<template>
  <div>
    <Multiselect
      v-model="value"
      :options="options"
    />
  </div>
</template>

<script>
  import Multiselect from '@vueform/multiselect'

  export default {
    components: {
      Multiselect,
    },
    data() {
      return {
        value: null,
        options: [
          'Batman',
          'Robin',
          'Joker',
        ]
      }
    }
  }
</script>

<style scoped>
/* Scoped style for multiselect dropdown */
.multiselect-dropdown {
  width: 600px !important;
}
</style>

If it doesn't work, you can read the source directly, and look for the class and customize it yourself.

@Adikaarif
Copy link
Author

What if I have 3 multiselect in a file and I only want one of them to have a dropdown width of 600px?

@rafia9005
Copy link

rafia9005 commented Dec 17, 2024

<Multiselect
      v-model="value3"
      :options="options"
      :classes="{ dropdown: 'custom-dropdown-width' }"
    />

<style scoped>
.custom-dropdown-width {
  width: 600px !important;
}
</style>

try again

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

No branches or pull requests

2 participants