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

195
Views
Cadena a matriz con condición

Tengo un accesorio en vue como este,

 props: { variant : String }

pero quiero que sea una matriz si el valor de la variante es mayor que 1. ¿Cómo puedo hacerlo?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

puedes usar computed para reemplazarlo

 props: { variant : String }, computed: { computedVariant() { return this.variant.length > 1 ? [this.variant] : this.variant } }

luego use la variante computedVariant en lugar de la variant en su plantilla

 <div>{{ computedVariant }}</div>
about 4 years ago · Santiago Gelvez 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!