mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
57 lines
1.4 KiB
Vue
57 lines
1.4 KiB
Vue
<template>
|
|
<div class="image-outline">
|
|
<ImageRectOutline
|
|
v-if="clipShape.type === 'rect'"
|
|
:width="elementInfo.width"
|
|
:height="elementInfo.height"
|
|
:radius="clipShape.radius"
|
|
:outline="elementInfo.outline"
|
|
/>
|
|
<ImageEllipseOutline
|
|
v-else-if="clipShape.type === 'ellipse'"
|
|
:width="elementInfo.width"
|
|
:height="elementInfo.height"
|
|
:outline="elementInfo.outline"
|
|
/>
|
|
<ImagePolygonOutline
|
|
v-else-if="clipShape.type === 'polygon'"
|
|
:width="elementInfo.width"
|
|
:height="elementInfo.height"
|
|
:outline="elementInfo.outline"
|
|
:createPath="clipShape.createPath"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { computed, defineComponent, PropType } from 'vue'
|
|
import { PPTImageElement } from '@/types/slides'
|
|
import useClipImage from '../useClipImage'
|
|
|
|
import ImageRectOutline from './ImageRectOutline.vue'
|
|
import ImageEllipseOutline from './ImageEllipseOutline.vue'
|
|
import ImagePolygonOutline from './ImagePolygonOutline.vue'
|
|
|
|
export default defineComponent({
|
|
name: 'image-outline',
|
|
components: {
|
|
ImageRectOutline,
|
|
ImageEllipseOutline,
|
|
ImagePolygonOutline,
|
|
},
|
|
props: {
|
|
elementInfo: {
|
|
type: Object as PropType<PPTImageElement>,
|
|
required: true,
|
|
},
|
|
},
|
|
setup(props) {
|
|
const clip = computed(() => props.elementInfo.clip)
|
|
const { clipShape } = useClipImage(clip)
|
|
|
|
return {
|
|
clipShape,
|
|
}
|
|
},
|
|
})
|
|
</script> |