Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

343
Vistas
How to let a multiline string returned by a function appear on multiple lines in a Vue template?

Quite straightforward but can't get it to work.

My method returns ${a}-${b} and in my template <td>{{ myFunction() }}</td>

So right now it returns A-B in my cell. I'd like to return A and then B on a new line. I've tried ${a}\n${b} or \n\ but it doesn't seem to be working.

Any suggestions ?

Thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In Vue, you are operating on HTML Template.

So you should use <br/> instead of \n

Instead of using <td>{{ myFunction() }}</td> You may use:

<td :html="myFunction()"></td>

NOTE: you must make sure that you trust the output of myFunction to not contain malicious code (XSS Attack)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda