0

I'm trying to display my product description, but when I render it, the text goes next to each other instead of underneath. So for example I'm getting

description 1 description 2

and what I'm trying to get is

description 1
description 2

When I save my description I save it like this

$description = "$description1. \r\n .$description2"
$product->description = $description;
$product->save();

and this is how I'm trying to render it in vue

<p v-html="product.description"></p>
Ixxi
  • 1
  • 2
  • 1
    https://stackoverflow.com/questions/36729634/rendering-newline-character-in-vuejs possible duplicate – Amine Ben Khelifa Feb 22 '22 at 12:28
  • 1
    Does this answer your question? [Rendering newline character in VueJS](https://stackoverflow.com/questions/36729634/rendering-newline-character-in-vuejs) – Debug Diva Feb 22 '22 at 12:34
  • I think this question is the same as https://stackoverflow.com/q/36729634/15760872 and I think my answer can help you https://stackoverflow.com/a/76883110/15760872 – Mohammadreza Khalili Aug 23 '23 at 18:38

1 Answers1

0

have you tried using the "
" tag similar to this:

$description = "$description1. <br> .$description2"

Haven't tested so syntax may be slightly different.

5henanigans
  • 59
  • 1
  • 6