|
1 | 1 | <template> |
2 | | - <div data-no-interaction> |
3 | | - <div v-bind="{ ...dragProps, ...doubleProps }" :style="containerStyle"> |
| 2 | + <div data-no-interaction :style="{ display: 'contents' }"> |
| 3 | + <div v-bind="{ ...dragProps, ...doubleProps }" :style="mergedContainerStyle"> |
4 | 4 | <slot :annotation="currentObject"></slot> |
5 | 5 |
|
6 | 6 | <template v-if="isSelected && isResizable"> |
|
53 | 53 | </div> |
54 | 54 | </template> |
55 | 55 |
|
| 56 | +<script lang="ts"> |
| 57 | +// Disable attribute inheritance so style doesn't fall through to root element |
| 58 | +export default { |
| 59 | + inheritAttrs: false, |
| 60 | +}; |
| 61 | +</script> |
| 62 | + |
56 | 63 | <script setup lang="ts" generic="T extends PdfAnnotationObject"> |
57 | 64 | import { ref, computed, watch, useSlots, toRaw, shallowRef, VNode } from 'vue'; |
58 | 65 | import { PdfAnnotationObject, Rect } from '@embedpdf/models'; |
@@ -88,6 +95,7 @@ const props = withDefaults( |
88 | 95 | onSelect: (event: TouchEvent | MouseEvent) => void; |
89 | 96 | zIndex?: number; |
90 | 97 | selectionOutlineColor?: string; |
| 98 | + style?: Record<string, string | number>; |
91 | 99 | }>(), |
92 | 100 | { |
93 | 101 | lockAspectRatio: false, |
@@ -260,6 +268,12 @@ const containerStyle = computed(() => ({ |
260 | 268 | zIndex: props.zIndex, |
261 | 269 | })); |
262 | 270 |
|
| 271 | +// Merge container style with passed style prop (for mixBlendMode, etc.) |
| 272 | +const mergedContainerStyle = computed(() => ({ |
| 273 | + ...containerStyle.value, |
| 274 | + ...(props.style ?? {}), |
| 275 | +})); |
| 276 | +
|
263 | 277 | // Add useSlots to access slot information |
264 | 278 | const slots = useSlots(); |
265 | 279 | </script> |
0 commit comments