0

How can we use @nuxt/content to display a markdown from a string? The idea is, I want to fetch some data from my firestore database, then display it.

So it'll be like,

const data = "
# Title
So this data has been returned from firebase, we just need to future out how to render it using a markdown previewer.
"

Now in the template, I want to just use nuxt-content to display this string (data)

Please note, I'd preferably like to use this @nuxt/content only for this, I'm aware of other markdown previerers, but I have some static files too which are being rendered using this same library, so I just want to reuse it to render stuff from database too.

bacon-delight
  • 665
  • 1
  • 7
  • 15
  • Hi @bacon-delight, do you have a code example for us? Displaying content should work with . – hawc Aug 25 '21 at 10:03
  • Hi @hawc, I tried something like: `` and the `data` is the string posted in the question. It didn't render anything. – bacon-delight Aug 25 '21 at 14:12
  • It could help to simply rename the variable. The keyword "data" is already defined by Vue. So you're probably not accessing you const called "data", but the Vue property called "data". – hawc Aug 25 '21 at 16:49
  • Yes yes, I have been using a different variable name in the project, just for posting the question here, I for some reason put it like that. Sorry for the confusion, but it's not working with any other name as well. – bacon-delight Aug 26 '21 at 17:47

0 Answers0