Skip to content

Attribute Inheritance broken when comment in template root #9591

Open
@tanjiasong005

Description

@tanjiasong005

Vue version

3.3.8

Link to minimal reproduction

https://play.vuejs.org/#eNp9UsFOwzAM/RUvl4K0rkK7bd0kQJOAAyCYxCWX0XlbRppESTqGqv47Tkq7HYBb/N6z/WynZtfGjA4VsgnLXWGF8eDQV2bOlSiNth5qsLiBBjZWl5CQNOmpW12aH3yUhSBUSqZccVVo5TyUbguzkH+R3KGUGt60letBcslVnrXtqBEFHksjVx4pAsh3V/O6jslNk2cURVQoU3k4pKVeo5xxRjxnLRWNOP8lkfBCS20n8C4rnHIGGUnyrG/Ahsw7crcR29HeaUWD16FGyCuNkGifjBfknrMJRCZwKzL/+RAxbyscdnixw+LjF3zvjgHj7NmiQ3tAznrOr+wWfUsvXh/xSO+epOEqSep/yBd0WlbBYyu7qdSabJ/potv7eCOhtku3OHpUrhsqGA3KJuo5o5uF/f01+snueDSOeVw1tMXu3uHnnM5nadmDNAVaZonKQ5q22Foc4gNgKTwNGLCsA8/P03wDu53amQ==

Steps to reproduce

Create a Component with a comment in template root

<template>
<!-- comment -->
<div>
  Title
</div>
</template>

Use the component.

<script setup>
import { ref } from 'vue'
import Comp from './Comp.vue';

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

<template>
  <h1>{{ msg }}</h1>
  <input v-model="msg">
  <Comp style="color: blue;" />
</template>

What is expected?

image

What is actually happening?

image

System Info

No response

Any additional comments?

No response

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