-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change(OAResponses) ResponseCode tabs design * feat(OAPath) path-mobile slot * chore(docs) Custom Slots * chore: release
- Loading branch information
1 parent
2161993
commit e6bce84
Showing
6 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
aside: false | ||
outline: false | ||
--- | ||
|
||
# Custom Slots | ||
|
||
The `OAOperation` component provides several slots for customizing the operation layout. | ||
|
||
## Description | ||
|
||
The `description` slot allows you to customize the operation description. | ||
|
||
```vue | ||
--- | ||
aside: false | ||
outline: false | ||
title: vitepress-theme-openapi | ||
--- | ||
<script setup lang="ts"> | ||
import { useRoute, useData } from 'vitepress' | ||
const route = useRoute() | ||
const { isDark } = useData() | ||
const operationId = route.data.params.operationId | ||
</script> | ||
<OAOperation :operationId="operationId" :isDark="isDark"> | ||
<template #description="description"> | ||
#### Custom description slot | ||
Here you can add any Markdown content or Vue components. | ||
<div class="p-3 bg-gray-100 border"> | ||
<p>Description content</p> | ||
</div> | ||
\`\`\`javascript | ||
console.log('Custom description slot') | ||
\`\`\` | ||
</template> | ||
</OAOperation> | ||
``` | ||
|
||
This will render the following: | ||
|
||
<div class="flex flex-col p-3 rounded border dark:border-gray-700"> | ||
|
||
<script setup lang="ts"> | ||
import { useRoute, useData } from 'vitepress' | ||
|
||
const route = useRoute() | ||
|
||
const { isDark } = useData() | ||
</script> | ||
|
||
<OAOperation operationId="getMuseumHours" :isDark="isDark"> | ||
|
||
<template #description="description"> | ||
|
||
#### Custom description slot | ||
|
||
Here you can add any Markdown content or Vue components. | ||
|
||
<div class="p-3 bg-gray-100 border"> | ||
<p>Description content</p> | ||
</div> | ||
|
||
```javascript | ||
console.log('Custom description slot') | ||
``` | ||
|
||
</template> | ||
|
||
</OAOperation> | ||
|
||
</div> | ||
|
||
## WIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "vitepress-theme-openapi", | ||
"type": "module", | ||
"version": "0.0.3-alpha.22", | ||
"version": "0.0.3-alpha.23", | ||
"packageManager": "[email protected]", | ||
"homepage": "https://vitepress-theme-openapi.vercel.app/", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters