Bouton
Pour afficher un bouton, nous utilisons le composant, le bouton .
Le composant Bouton de l’interface utilisateur JSON représente un code HTML. <button/>
.
const buttonJSON = {
"component": "button",//tells the component name
"label": "Yes, login",//tells the text for the button
"variant": "cta",//tells the variants for the button which provides default styles
"on-click": "done",//tells what function to run after user clicks the button
};
Cela génère un bouton avec un libellé Yes, login
. Les autres propriétés incluent, sans s’y limiter, variant, label, on-click.
REMARQUE : La variable
on-<events>
est la syntaxe permettant d’appeler les commandes dans les contrôleurs.
Le bouton rendu se présente comme suit :
recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178