Skip to content

Attributes with undefined value are not removed #13228

Open
@Gwynerva

Description

@Gwynerva

Vue version

5.8.3

Link to minimal reproduction

Playground

Steps to reproduce

<script lang="ts" setup>
import { ref } from 'vue'

const msg = ref('Hello World!')
</script>

<template>
  <h1 :style="undefined" :class="undefined">{{ msg }}</h1>
  <input v-model="msg" />
</template>

When SSR is OFF it renders <h1 class>...</h1>.
When SSR is ON it renders <h1 style class>...</h1>.

What is expected?

When attribute has undefined value it should be completely removed from node: <h1>...</h1>

What is actually happening?

Attribute names are present but with empty values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions