返回 slidev
PlantUml.vue
根目录 / packages / client / builtin / PlantUml.vue
1 <!--
2 PlantUML
3 (auto transformed, you don't need to use this component directly)
4
5 Usage:
6
7 ```plantuml
8 @startuml
9 Alice -> Bob : Hello!
10 @enduml
11 ```
12 -->
13 <script setup lang="ts">
14 import { computed } from 'vue'
15
16 const props = withDefaults(defineProps<{
17 code: string
18 server: string
19 scale?: number
20 alt?: string
21 }>(), {
22 alt: 'PlantUML diagram',
23 })
24
25 const uri = computed(() => `${props.server}/svg/${props.code}`)
26 </script>
27
28 <template>
29 <img :src="uri" :style="{ scale }" :alt="alt">
30 </template>
31
31 lines Plain Text