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

169
Views
actualizar la lista y volver a renderizar la plantilla vue

Tengo un escenario en el que, en cierto punto, se actualizará la lista desplegable de valores. Supongamos que tenemos una lista de frutas en el menú desplegable. al presionar una tecla, actualizaré la lista de frutas con la lista de flores, esto es solo un ejemplo. ¿Cómo puedo actualizar la lista en vivo? Leí la reactividad en profundidad aquí, pero no obtuve mucha ayuda. Esta pregunta es parte de esta pregunta aquí .

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

0

 new Vue({ el: "#app", data: () => ({ type: 'fruits', fruits: ['apple', 'banana', 'cherry'], animals: ['cat', 'dog', 'rabbit'], }), computed: { list() { return { fruits: this.fruits, animals: this.animals }[this.type] } }, methods: { change(type){ this.type = type } } })
 <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <div id="app"> <button @click.prevent="change('animals')"> Animals </button> <button @click.prevent="change('fruits')"> Fruits </button> <ul> <li v-for="item in list">{{ item }}</li> </ul> </div>

Se agregó un fragmento simple para mostrar cómo se puede usar la reactividad para mostrar la lista según alguna opción.

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!