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
Copy file name to clipboardExpand all lines: docs/content/3.guide/1.writing/3.mdc.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Any component in the `components/content/` directory or [made available globally
16
16
The component must contain either:
17
17
18
18
- A `<slot />`{lang="html"} to accept raw text or another component.
19
-
- The `<Markdown />`{lang="html"} component to accept formatted text.
19
+
- The `<ContentSlot />`{lang="html"} component to accept formatted text.
20
20
21
21
In a markdown file, use the component with the **`::`** identifier.
22
22
@@ -107,15 +107,15 @@ You can add more `::::` when nesting components as a visual reminder.
107
107
108
108
### Markdown rendering
109
109
110
-
The `<Markdown />`{lang="html"} component is auto-imported by Nuxt Content. It acts as a special slot that accepts rich text rendered by Markdown.
110
+
The `<ContentSlot />`{lang="html"} component is auto-imported by Nuxt Content. It acts as a special slot that accepts rich text rendered by Markdown.
111
111
112
112
The `unwrap` prop accepts an HTML tag that will be used to unwrap the content, useful when using tags such as title tags (`<h1>`{lang="html"}, `<h2>`{lang="html"}, ...) or inline tags (`<button>`{lang="html"}, `<a>`{lang="html"}, ...).
113
113
114
114
::code-group
115
115
```html [TheTitle.vue]
116
116
<template>
117
117
<h1class="text-4xl">
118
-
<Markdown:use="$slots.default"unwrap="p" />
118
+
<ContentSlot:use="$slots.default"unwrap="p" />
119
119
</h1>
120
120
</template>
121
121
```
@@ -131,15 +131,15 @@ The `unwrap` prop accepts an HTML tag that will be used to unwrap the content, u
131
131
::
132
132
::
133
133
134
-
The `<Markdown />` component can act as a named slot with the `use` property:
134
+
The `<ContentSlot />` component can act as a named slot with the `use` property:
135
135
136
136
```html
137
-
<Markdown:use="$slots.description"unwrap="p">
137
+
<ContentSlot:use="$slots.description"unwrap="p">
138
138
```
139
139
140
140
## Inline components
141
141
142
-
Inline components are components without slots or `<Markdown />`.
142
+
Inline components are components without slots or `<ContentSlot />`.
description: 'The fastest way to inject Markdown into your Vue components.'
4
+
---
5
+
6
+
The `<ContentSlot>`{lang=html} component makes it easier to use Markdown syntax in your Vue components.
7
+
8
+
It is useful when creating components that you want to use in your Markdown content.
9
+
10
+
## Props
11
+
12
+
-`use`{lang=ts}: The slot to bind on, you must provide a `use`{lang=ts} via `$slots.{your_slot}`{lang=ts} in `<template>`{lang=html}.
13
+
- Type: Vue slot `Function`
14
+
- Example: `$slots.default`{lang=ts}
15
+
-`unwrap`{lang=ts}: 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.
0 commit comments