Browse Source

chore: fix width/height check condition

Evan You 2 năm trước cách đây
mục cha
commit
6fcec3b2c7
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  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'
     )
   }