Bläddra i källkod

fix: passing class and style attrs only (#423)

Alvaro Saburido 1 år sedan
förälder
incheckning
8fd991a032
2 ändrade filer med 4 tillägg och 1 borttagningar
  1. 2 0
      playground/src/components/TheExperience.vue
  2. 2 1
      src/components/TresCanvas.vue

+ 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>