fix(runtime-dom): consistently remove boolean attributes for falsy values (#4348)
This commit is contained in:
@@ -43,7 +43,8 @@ import {
|
||||
SSR_RENDER_DYNAMIC_ATTR,
|
||||
SSR_RENDER_ATTRS,
|
||||
SSR_INTERPOLATE,
|
||||
SSR_GET_DYNAMIC_MODEL_PROPS
|
||||
SSR_GET_DYNAMIC_MODEL_PROPS,
|
||||
SSR_INCLUDE_BOOLEAN_ATTR
|
||||
} from '../runtimeHelpers'
|
||||
import { SSRTransformContext, processChildren } from '../ssrCodegenTransform'
|
||||
|
||||
@@ -237,7 +238,10 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
|
||||
if (isBooleanAttr(attrName)) {
|
||||
openTag.push(
|
||||
createConditionalExpression(
|
||||
value,
|
||||
createCallExpression(
|
||||
context.helper(SSR_INCLUDE_BOOLEAN_ATTR),
|
||||
[value]
|
||||
),
|
||||
createSimpleExpression(' ' + attrName, true),
|
||||
createSimpleExpression('', true),
|
||||
false /* no newline */
|
||||
|
||||
Reference in New Issue
Block a user