You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I created a <playgrounds> component in Vue and I render it in the slides.md.
This component requires to accept props code for multi-line code snippets as Array<string>.
I did not find a nice way to render it inside the markdown.
I could render it like:
::playgrounds{:code=`["export default function A(){ \n return <h1>hi</h1> }", "const b = 2", "const c = a + b"]`}
::
Using mdc does not support the MDC YAML format because slidev treats it as a new slide.
I could think of an interface like the slots in a layout:
But I need the props to be as strings instead of slots (because I don't render them directly to the dom), and I need it as an array.
The advantage of this syntax is that it support multi-lines, easy to read and formatted well with tools.
What do you think? I'm open to suggestions, but currently I don't like that I need to render the component prop array in a single and use \n or escaping. A new syntax for it / support syntax to convert named slots syntax in markdwon as regular props would be nice
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I created a
<playgrounds>
component in Vue and I render it in theslides.md
.This component requires to accept props
code
for multi-line code snippets asArray<string>
.I did not find a nice way to render it inside the markdown.
I could render it like:
Using
mdc
does not support the MDC YAML format because slidev treats it as a new slide.I could think of an interface like the slots in a layout:
But I need the props to be as strings instead of slots (because I don't render them directly to the dom), and I need it as an array.
The advantage of this syntax is that it support multi-lines, easy to read and formatted well with tools.
What do you think? I'm open to suggestions, but currently I don't like that I need to render the component prop array in a single and use
\n
or escaping. A new syntax for it / support syntax to convert named slots syntax in markdwon as regular props would be niceBeta Was this translation helpful? Give feedback.
All reactions