Jelajahi Sumber

fix: passing class and style attrs only

alvarosabu 1 tahun lalu
induk
melakukan
f820d0aa5b

+ 2 - 0
playground/src/components/TheExperience.vue

@@ -35,7 +35,9 @@ watchEffect(() => {
   <TresCanvas
     v-bind="gl"
     ref="canvas"
+    window-size
     class="awiwi"
+    :style="{ background: '#008080' }"
   >
     <TresPerspectiveCamera
       :position="[7, 7, 7]"

+ 2 - 1
src/components/TresCanvas.vue

@@ -181,7 +181,7 @@ onMounted(() => {
   <canvas
     ref="canvas"
     :data-scene="scene.uuid"
-    v-bind="$attrs"
+    :class="$attrs.class"
     :style="{
       display: 'block',
       width: '100%',
@@ -191,6 +191,7 @@ onMounted(() => {
       left: 0,
       pointerEvents: 'auto',
       touchAction: 'none',
+      ...$attrs.style as Object,
     }"
   />
 </template>