markdown and chat
-
How to use
@quasar/qmarkdown
inQChat
component? -
@matroskin - Your going to have to put some effort into looking at the docs yourself. Those questions are much too general.
Scott
-
nevertheless, I see in docs how to use markdown component, like this
<q-markdown>text</q-markdown>
but how can I use it in methods? -
Took me 30 seconds to find this. What docs are you looking at?
https://quasarframework.github.io/app-extension-qmarkdown/docs
Scott
-
@matroskin You mean more like a Quasar plugin, type functionality?
-
Now that I’ve read his post for a third time, I think he’s talking about adding QMarkdown to the Chat component.
If that’s the case:
<template> <div class="q-pa-md row justify-center"> <div style="width: 100%; max-width: 400px"> <q-chat-message name="me" avatar="https://cdn.quasar.dev/img/avatar3.jpg" stamp="7 minutes ago" sent bg-color="amber-7" > <q-markdown :src="someMarkdown"/> </q-chat-message> </div> </div> </template>
@Hawkeye64 - Correct me if I’m wrong.
Scott
-
Yep, but messages is Array, so I should use v-for in default slot of
q-chat-message
, am I right? -
Sort of. You’ll need to probably do a bit more, like with QVirtualScroll or QInfiniteScroll for the overall solution.
Scott
-
Perfect! Love it.