Skip to content

Commit

Permalink
chore: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Nov 23, 2024
1 parent 26cfbb1 commit 8d98009
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/compiler-vapor/src/generators/prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ export function genSetProp(
} else if (modifier) {
helperName = modifier === '.' ? 'setDOMProp' : 'setAttr'
} else if (
attributeCache[attrCacheKey] ||
(attributeCache[attrCacheKey] = shouldSetAsAttr(tag.toUpperCase(), keyName))
attributeCache[attrCacheKey] === undefined
? (attributeCache[attrCacheKey] = shouldSetAsAttr(
tag.toUpperCase(),
keyName,
))
: attributeCache[attrCacheKey]
) {
helperName = 'setAttr'
} else if (
Expand Down
5 changes: 3 additions & 2 deletions packages/runtime-vapor/src/dom/prop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ function shouldSetAsProp(

const attrCacheKey = `${el.tagName}_${key}`
if (
attributeCache[attrCacheKey] ||
(attributeCache[attrCacheKey] = shouldSetAsAttr(el.tagName, key))
attributeCache[attrCacheKey] === undefined
? (attributeCache[attrCacheKey] = shouldSetAsAttr(el.tagName, key))
: attributeCache[attrCacheKey]
) {
return false
}
Expand Down

0 comments on commit 8d98009

Please sign in to comment.