1

I'm trying to fetch data from my database and display it as HTML content but it only turns out as a string, I'm using vuejs component in laravel. This is the code

<div id="main-window" v-for="post in posts">
<div class="post">
  <div class="content">
    {{post.content}}
  </div>
</div>

How can I use the post.content as HTML?

1 Answer 1

5

You need to use v-html binding. Docs

<div id="main-window" v-for="post in posts">
  <div class="post">
    <div class="content" v-html="post.content">
  </div>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.