Kaynağa Gözat

chore: fix width/height check condition

Evan You 2 yıl önce
ebeveyn
işleme
6fcec3b2c7
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      packages/runtime-dom/src/patchProp.ts

+ 5 - 2
packages/runtime-dom/src/patchProp.ts

@@ -113,8 +113,11 @@ function shouldSetAsProp(
   // #8780 the width or heigth of embedded tags must be set as attribute
   if (key === 'width' || key === 'height') {
     const tag = el.tagName
-    return (
-      tag === 'IMG' || tag === 'VIDEO' || tag === 'CANVAS' || tag === 'SOURCE'
+    return !(
+      tag === 'IMG' ||
+      tag === 'VIDEO' ||
+      tag === 'CANVAS' ||
+      tag === 'SOURCE'
     )
   }