2

I have a Blog/News kind of Website which means there will be Posts, they have a content which is a string of HTML stored in my database.

Since I also need stuff like Sliders and so on which won´t get generated via v-html I thought about what is the best practice to render a HTML String I retrieve from the Database on the Website Frontend.

I readed the Vue Docs about Render Functions but wasn´t able to solve my problem with the information there.

Example HTML String for understanding

<div class="slidercontainer">
   <slider :options="optionPreset1"></slider>
</div>

I save those presets in the finished Post Component. If there is any better way to solve this kind of thing with a DB then tell me, its not in Production yet so I can change such crucial things.

niclas_4
  • 3,514
  • 1
  • 18
  • 49

1 Answers1

1

You need to use dynamic components. See this answer.

tony19
  • 125,647
  • 18
  • 229
  • 307
Roy J
  • 42,522
  • 10
  • 78
  • 102