Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
elemento encendido incapaz de renderizar para cada ciclo

Estoy teniendo una propiedad de objeto como tal

 pageSizeValues: { type: Object }

que se está instanciando así

 this.pageSizeValues = {10: 10, 25: 25, 50: 50};

En base a esto, me gustaría crear un menú desplegable con 3 entradas, es decir, iterando sobre pageSizeValues

 <vaadin-select @change="${event => this.setLimit(event.target.value)}" value="${this.limit}" placeholder="Page Size" style="width: 80px"> <template> <vaadin-list-box> ${Object.entries(this.pageSizeValues).forEach(([key, val]) => { console.log(key + " " + val); html` <vaadin-item value=${key}>${val}</vaadin-item> ` })} </vaadin-list-box> </template> </vaadin-select>

Si bien console.log muestra correctamente los pares clave-valor en la interfaz de usuario, no obtengo los elementos en absoluto.

Logré representar los elementos correctamente cuando estaba iterando sobre una matriz en lugar de un objeto, por lo que no estoy seguro de dónde podría estar el problema.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe devolver el valor html o simplemente se crea y se descarta. La forma más fácil es usar map en lugar de forEach

 ${Object.entries(this.pageSizeValues).map(([key, val]) => { console.log(key + " " + val); return html` <vaadin-item value=${key}>${val}</vaadin-item> ` })}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!