feat. video 컴포넌트 추가
This commit is contained in:
16
layers/components/atoms/Video.vue
Normal file
16
layers/components/atoms/Video.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
interface Props {
|
||||
src: string
|
||||
type?: 'mp4' | 'webm'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
type: 'mp4',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<video v-if="props.src">
|
||||
<source :src="props.src" :type="`video/${props.type}`" v-bind="$attrs" />
|
||||
</video>
|
||||
</template>
|
||||
@@ -87,8 +87,7 @@ const handleSplideMove = (_splide: SplideType, newIndex: number) => {
|
||||
:resources-data="getComponentGroup(item, 'description')"
|
||||
class="mt-2 text-left md:mt-5"
|
||||
/>
|
||||
<video
|
||||
v-if="hasComponentGroup(item, 'video')"
|
||||
<AtomsVideo
|
||||
:src="currentVideoSrc(item)"
|
||||
:autoplay="currentSlideIndex === index"
|
||||
muted
|
||||
|
||||
Reference in New Issue
Block a user