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 setting maxlenght in component? #241

Closed
cit-eriks opened this issue Jun 26, 2017 · 3 comments
Closed

How to setting maxlenght in component? #241

cit-eriks opened this issue Jun 26, 2017 · 3 comments

Comments

@cit-eriks
Copy link

I need to set the maxlength for this component, but I don't know.

@sagalbot
Copy link
Owner

As in, the number of selections allowed?

@cit-eriks
Copy link
Author

cit-eriks commented Jun 28, 2017

I need to declare a quantity of 2 characters in the input that it builds inside the component. Therefore, I need the input (maxlength) to limit these characters.

<input type="text" name="state" maxlength="2">

@sagalbot
Copy link
Owner

sagalbot commented Mar 8, 2020

You can use a scoped slot for this:

<v-select>
  <template #search="{events, attributes}">
    <input class="vs__search" v-on="events" v-bind="attributes" maxlength="2" />
  </template>
</v-select>

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

No branches or pull requests

2 participants