|
1 | | -<script setup lang='ts'> |
2 | | -import type { BundledLanguage } from 'shiki' |
3 | | -import { transformerCopyButton } from '@selemondev/shiki-transformer-copy-button' |
4 | | -import CodeBlock from 'shiki-code-block-vue' |
| 1 | +<script setup lang="ts"> |
| 2 | +import type { BundledLanguage } from "shiki"; |
| 3 | +import { transformerCopyButton } from "@selemondev/shiki-transformer-copy-button"; |
| 4 | +import CodeBlock from "shiki-block-vue"; |
5 | 5 |
|
6 | 6 | const props = defineProps<{ |
7 | | - code: string |
8 | | - lang: BundledLanguage |
9 | | -}>() |
| 7 | + code: string; |
| 8 | + lang: BundledLanguage; |
| 9 | +}>(); |
10 | 10 | </script> |
11 | 11 |
|
12 | 12 | <template> |
13 | | - <CodeBlock |
14 | | - :code="props.code" :lang="props.lang" :theme="{ |
15 | | - light: 'vitesse-light', |
16 | | - dark: 'vitesse-dark', |
17 | | - }" :transformers="[ |
18 | | - transformerCopyButton({ |
19 | | - duration: 3000, |
20 | | - display: 'ready', |
21 | | - successIcon: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E`, |
22 | | - copyIcon: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E`, |
23 | | - }), |
24 | | - ]" |
25 | | - /> |
| 13 | + <CodeBlock |
| 14 | + :code="props.code" |
| 15 | + :lang="props.lang" |
| 16 | + :theme="{ |
| 17 | + light: 'vitesse-light', |
| 18 | + dark: 'vitesse-dark', |
| 19 | + }" |
| 20 | + :transformers="[ |
| 21 | + transformerCopyButton({ |
| 22 | + duration: 3000, |
| 23 | + display: 'ready', |
| 24 | + successIcon: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E`, |
| 25 | + copyIcon: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E`, |
| 26 | + }), |
| 27 | + ]" |
| 28 | + /> |
26 | 29 | </template> |
0 commit comments