File size: 411 Bytes
89ce340
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { computed, type Ref } from 'vue'
import type { PPTElementShadow } from '@/types/slides'

// 计算元素的阴影样式
export default (shadow: Ref<PPTElementShadow | undefined>) => {
  const shadowStyle = computed(() => {
    if (shadow.value) {
      const { h, v, blur, color } = shadow.value
      return `${h}px ${v}px ${blur}px ${color}`
    }
    return ''
  })

  return {
    shadowStyle,
  }
}