Skip to content

Commit a861e8d

Browse files
fix: handle scoped styles on multiple roots component
1 parent ba8fb40 commit a861e8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/FreecasterPlayer.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useAttrs, computed } from 'vue'
2+
import { useAttrs, computed, getCurrentInstance } from 'vue'
33
import { usePlayer } from '../composables/player'
44
import type { Player, PlayerOptions, PlayerEvents } from '../types/Player'
55
@@ -23,6 +23,8 @@
2323
2424
export type FreecasterPlayerEmits = PlayerEvents
2525
26+
const scopeId = getCurrentInstance().parent.proxy.$options.__scopeId
27+
2628
const props = defineProps<FreecasterPlayerProps>()
2729
const slots = defineSlots<FreecasterPlayerSlots>()
2830
const emit = defineEmits<FreecasterPlayerEmits>()
@@ -105,6 +107,7 @@
105107
<div
106108
ref="element"
107109
v-bind="{
110+
...(scopeId ? { [scopeId]: '' } : null),
108111
...attrs,
109112
...attributes
110113
}"

0 commit comments

Comments
 (0)