<ContentSlot>
The fastest way to inject Markdown into your Vue components.
The <ContentSlot>
component makes it easier to use Markdown syntax in your Vue components.
It is useful when creating components that you want to use in your Markdown content.
Props
use
: The slot to bind on, you must provide ause
via$slots.{your_slot}
in<template>
.- Type: Vue slot
Function
- Example:
$slots.default
- Type: Vue slot
unwrap
: Whether to unwrap the content or not. This is useful when you want to extract the content nested in native Markdown syntax. Each specified tag will get removed from AST.- Type:
Boolean
orString
- Default:
false
- Example:
'ul li'
- Type:
Example
components/FancyHeader.vue
<template> <h2 class="fancy-header"><ContentSlot :use="$slots.default" unwrap="p" /></h2></template>
content/index.md
::fancy-headerThat text paragraph will be unwrapped.::