Elenco

Per visualizzare un elenco, utilizziamo l’elenco dei componenti.

const listJSON =  {
    "component": "list", //tells the component name
    "data": "@languages", // an array of list items
},

In questo caso, il linguaggio è un semplice array di stringhe. languages = ["English", "Hindi", "French"]
Se desideri eseguire il rendering di un elenco di oggetti, possiamo specificare la struttura utilizzando la configurazione dell’elemento.

const listJSON =  {
    "component": "list", //tells the component name
    "data": "@projects", // an array of list items
    "itemConfig": { // used to define the structure of the list items.
    "component": "widget",
    "id": "checkbox_label"
    }
},

In genere itemConfig è un widget. Per ulteriori informazioni sui widget, vai a Widget

L’elenco renderizzato sarà simile al seguente:

elenco

recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178