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

336
Views
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 answers
Answer question

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 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!