Skip to content

Attributes with undefined value are not removed #13228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Gwynerva opened this issue Apr 21, 2025 · 1 comment
Open

Attributes with undefined value are not removed #13228

Gwynerva opened this issue Apr 21, 2025 · 1 comment

Comments

@Gwynerva
Copy link

Gwynerva commented Apr 21, 2025

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.

@jacekkarczmarczyk
Copy link
Contributor

#3173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants