Select fields components are used for collecting user provided information from a list of options.
When using objects for the items prop, you must associate item-text and item-value with existing properties on your objects. These values are defaulted to text and value and can be changed.
The auto property of menu-props is only supported for the default input style.
Wählen Sie unten Ihren gewünschte Komponente aus und sehen Sie die verfügbaren Attribute, Slots, Ereignisse und Funktionen.
Appends an icon to the component, uses the same syntax as v-icon
Appends an icon to the outside the component's input, uses same syntax as v-icon
Gibt an, zu welchem DOM-Element diese Komponente sich trennen soll. String - Kann jeder gültige QuerySelector sein. Objekt - Lann jeder gültige Knoten sein. Dies wird standardmäßig an den Root-v-app
Component anhängt.
Enables autofocus
Changes the background-color of the input
Keeps a local unique copy of all items that have been passed through the items prop.
Changes display of selections to chips
Applied when using clearable and the input is dirty
Fügt die Funktionalität zum Löschen der Eingabe hinzu, das Standard-Icon ist das Material Icon clear
Wendet eine bestimmte Farbe für die Steuerung an - es kann der Name der Materialfarbe sein (zum Beispiel success
oder purple
) oder css-Farben (#033
oder rgba(255, 0, 0, 0.5)
). Sie finden eine Liste der eingebauten Klassen auf der Farbseite.
Creates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation.
Applies the dark theme variant to the component. This will default the components color to white unless you've configured your application theme to dark or if you are using the color prop on the component. You can find more information on the Material Design documentation for dark themes.
Adds a remove icon to selected chips
Reduces the input height
Disables keyboard lookup
Disables the input
Erzwingt den Inhalt der Komponenten unter mount gezeichnet zu werden. Dies ist nützlich, wenn Sie Inhalte haben, die nicht im DOM dargestellt werden, aber für SEO crawlebar sein soll.
Stellt die Eingabe manuel in einen Fehlerzustand
Die Gesamtzahl der Fehler, die auf einmal angezeigt werden sollen
Stellt die Eingabe in einen Fehlerzustand und durchläuft benutzerdefinierte Fehlermeldungen. Wird mit allen Validierungen kombiniert, die vom rules-Prop auftreten. Dieses Feld wird keine Validierung auslösen
Applies the alternate filled input style
The function used for filtering items
Entfernt die Höhe (Schatten), welcher zum Element hinzugefügt wurde, wenn die solo oder solo-invertierten-Props verwendet werden
Designates input type as full-width
Sets the height of the input
Hides hint and validation errors. When set to auto
messages will be rendered only if there's a message (hint, error message, counter value etc) to display
Do not display in the select menu items that are already selected
Hint text
Setzt den DOM identifier auf der Komponente
Sets color of selected items
Set property of items's disabled value
Set property of items's text value
Set property of items's value - must be primitive. Dot notation is supported. Note: This is currently not supported with v-combobox
GitHub Issue
Can be an array of objects or array of strings. When using objects, will look for a text, value and disabled keys. This can be changed using the item-text, item-value and item-disabled props. Objects that have a header or divider property are considered special cases and generate a list header or divider; these items are not selectable.
{
text: string | number | object
value: string | number | object
disabled: boolean
divider: boolean
header: string
}
Sets input label
Wendet die helle Theme-Variante für die Komponente an.
Legt die Höhe des Laders fest
Zeigt den linearen Fortschrittsbalken an. Kann entweder eine Zeichenfolge sein, die angibt, welche Farbe auf den Fortschrittsbalken angewendet wird (jede Materialfarbe oder Themenfarbe - primary, secondary, success, info, warning, error) oder ein Boolescher Wert, der die Komponenten-color (festgelegt durch das color-prop - sofern dies von der Komponente unterstützt wird) oder die Primärfarbe verwendet
Pass props through to the v-menu
component. Accepts either a string for boolean props menu-props="auto, overflowY"
, or an object :menu-props="{ auto: true, overflowY: true }"
Zeigt eine Liste von Nachrichten oder eine einzelne Nachricht an, wenn eine Zeichenkette (string) verwendet wird
Changes select to multiple. Accepts array for value
Text wird angezeigt, wenn keine Daten vorhanden sind
When using the clearable prop, once cleared, the select menu will either open or stay open, depending on the current state
Applies the outlined style to the input
Forces hint to always be visible
Sets the input’s placeholder text
Displays prefix text
Prepends an icon to the component, uses the same syntax as v-icon
Prepends an icon inside the component's input, uses the same syntax as v-icon
Setzt die Eingabe in einen schreibgeschützten Zustand
Changes the selection behavior to return the object directly rather than the value specified with item-value
Reverses the input orientation
Adds a border radius to the input
Akzeptiert ein Array von Funktionen, die einen Eingabewert als Argument annehmen und entweder true
/ false
oder einen string
mit einer Fehlermeldung zurückgeben
Round if outlined
and increase border-radius
if filled
. Must be used with either outlined
or filled
Das Label bewegt sich nicht für focus/dirty
Changes display of selections to chips with the small property
Ändert den Stil der Eingabe
Reduziert die Deckkraft des Elements wenn nicht fokussiert
Setzt die Eingabe manuel in einen Erfolgszustand
Stellt die Eingabe in einen Erfolgszustand ein und überträgt benutzerdefinierte Erfolgsmitteilungen.
Displays suffix text
Sets input type
Verzögert die Validierung bis zum 'blur'-Ereignis
The input's value
The comparison algorithm used for values. More info
Adds an item inside the input and after input content
Adds an item after menu content
Adds an item outside the input and after input content
Der Standard-Vue Slot.
Define a custom item appearance
{
parent: VueComponent
item: object
on: object // Only needed when providing your own v-list-item
attrs: object // Only needed when providing your own v-list-item
}
Ersetzt die Standardbezeichnung
Customize the messages slot.
{
key: number, // the messages index
message: string, // the message
}
Wird angezeigt, wenn keine gefilterten Elemente vorhanden sind
Adds an item outside the input and before input content
Adds an item inside the input and before input content
Adds an item before menu content
Slot für den benutzerdefinierten linearen Fortschritt (angezeigt wenn das loading-Props ungleich zu Boolean False ist)
Define a custom selection appearance
{
parent: VueComponent
item: object
index: number
select: function
selected: boolean
disabled: boolean
}
Emitted when the input is blurred
Event
Emitted when the input is changed by user interaction
any
Emitted when input is clicked
MouseEvent
Emitted when appended icon is clicked
Event
Emitted when appended outer icon is clicked
Event
Emitted when clearable icon clicked
Event
Emitted when prepended icon is clicked
Event
Emitted when prepended inner icon is clicked
Event
Emitted when component is focused
Event
Das aktualisierte gebundene Modell
any
Emitted when any key is pressed
KeyboardEvent
Emitted when click is pressed
MouseEvent
Emitted when click is released
MouseEvent
Das error.sync
Ereignis
boolean
Emitted when menu item is selected using keyboard arrows
number
The search-input.sync
event
string
0.2 !default;
true !default;
4px !default;
68px !default;
40px !default;
40px !default;
42px !default;
0 4px 0 4px !default;
5px 4px 3px 0 !default;
4px 0 !default;
8px 0 !default;
20px !default;
7px !default;
.22 !default;
18px !default;
7px 4px 7px 0 !default;
20px !default;
38px !default;
26px !default;
Browser autocomplete is set to off by default, may vary by browser and may be ignored. MDN
Unten finden Sie eine Sammlung einfacher bis komplexer Beispiele.
You cannot use disabled v-select
.
You cannot use read-only v-select
, but it looks default.
A standard single select has a multitude of configuration options.
Use a custom prepended or appended icon.
A multi-select can utilize v-chip
as the display for selected items.
You can use dense
prop to reduce the field height and lower max height of list items.
You can specify the specific properties within your items array correspond to the text and value fields. By default, this is text and value. In this example we also use the return-object
prop which will return the entire object of the selected item on selection.
Custom props can be passed directly to v-menu
using menuProps
prop. In this example menu is force directed to top and shifted to top.
The v-select
components can be optionally expanded with prepended and appended items. This is perfect for customized select-all functionality.
The selection
slot can be used to customize the way selected values are shown in the input. This is great when you want something like foo (+20 others)
or don't want the selection to occupy multiple lines.
Bereit für mehr? Weiter lesen mit: