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

154
Views
Crear una función dinámica con una función dividida

No puedo hacerlo. Espero que alguien pueda ayudarme con esto.

 modus.value.getCurrentDataPath = sale.id (STRING)

O

 modus.value.getCurrentDataPath = id (STRING)

En el siguiente ejemplo, quiero verificar si modus.value.getCurrentDataPath incluye un archivo . (punto) o no. Al final quiero crear un router.push{()}

 const route1 = [] as any; if (modus.value.getCurrentDataPath.includes('.')) { const test = modus.value.getCurrentDataPath.split('.') let i; for (i = 0; i < test.length; i++) { route1.push(test[i]) } } else { route1.push(modus.value.getCurrentDataPath); } router.push({ path: route.path + '/' + getCurrent.value[route1] });

Desafortunadamente esto no funciona. No puede leer las 2 cuerdas divididas.

Debería ser: getCurrent.value.sale.id

¿Cómo arreglar esto? Quiero que funcione para ambos. Con punto y sin punto. En un router.push.

about 4 years ago · Juan Pablo Isaza
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!