Option
<pc-option> Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Options define the selectable items within various form controls such as a select.
Additional demonstrations can be found in the select demos.
| Name | Beschreibung | Reflektiert | Standard |
|---|---|---|---|
value | The option’s value. When selected, the containing form control will receive this value. The value must be unique from other options in the same group. Values must not contain spaces, as spaces are used as delimiters when listing multiple values. Typ: string |
| "" |
disabled | Disables the option, preventing selection. Typ: boolean |
| false |
updateComplete | Ein schreibgeschütztes Promise, das erfüllt ist, sobald die Komponente fertig aktualisiert wurde. | ‐ |
Erfahre mehr über Attribute und Eigenschaften.
| Name | Beschreibung |
|---|---|
| (Standard) | The option’s label. |
prefix | Used to prepend an icon or similar element to the option. |
suffix | Used to append an icon or similar element to the option. |
Erfahre mehr über die Benutzung von Slots.
| Name | Beschreibung | Argumente |
|---|---|---|
getTextLabel() | Returns a plain text label based on the option’s content. | ‐ |
Erfahre mehr über Methoden.
| Name | Beschreibung |
|---|---|
checked-icon | The checked icon, a <pc-icon> element. |
base | The component’s base wrapper. |
label | The option’s label. |
prefix | The container that wraps the prefix. |
suffix | The container that wraps the suffix. |
Erfahre mehr über das Anpassen von CSS‐Parts.
Wenn du den Autoloader oder den Standard‐Loader nutzt, kannst du diesen Abschnitt überspringen. Falls du „Cherry Picking“ betreibst, kannst du die folgenden Snippets verwenden, um diese Komponente zu importieren.
Um diese Komponente manuell vom CDN zu importieren, kannst du dieses Code‐Snippet kopieren und es in dein HTML einfügen.
<script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/option/option.js"></script> Um diese Komponente manuell vom CDN zu importieren, kannst du dieses Code‐Snippet kopieren und es in deine JavaScript‐Datei einfügen.
import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/option/option.js"; Um diese Komponente manuell von npm zu importieren, kannst du dieses Code‐Snippet kopieren und es in deine JavaScript‐Datei einfügen.
import "placer-toolkit/dist/components/option/option.js"; Diese Komponente importiert automatisch folgende Komponenten: