返回 slidev
image-right.vue
根目录 / packages / client / layouts / image-right.vue
1 <script setup lang="ts">
2 import { computed } from 'vue'
3 import { handleBackground } from '../layoutHelper'
4
5 const props = defineProps({
6 image: {
7 type: String,
8 },
9 class: {
10 type: String,
11 },
12 backgroundSize: {
13 type: String,
14 default: 'cover',
15 },
16 })
17
18 const style = computed(() => handleBackground(props.image, false, props.backgroundSize))
19 </script>
20
21 <template>
22 <div class="grid grid-cols-2 w-full h-full auto-rows-fr">
23 <div class="slidev-layout default" :class="props.class">
24 <slot />
25 </div>
26 <div class="w-full h-full" :style="style" />
27 </div>
28 </template>
29
29 lines Plain Text