-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When creating a live Vue component with styles, it looks like this plugin generates the markup and gives the root component a unique data attribute. Styles are then generated for this component based on that attribute as follows:
Original Vue component:
<template>
<div class="parent">
<div class="child"></div>
</div>
</template>
<style>
.parent {
background: red;
}
.child {
background: blue;
}
</style>
Output HTML
<div class="parent" data-v-3ebe6f67>
<div class="child"></div>
</div>
Output styles
.parent[data-v-3ebe6f67] {
background: red;
}
.child[data-v-3ebe6f67] {
background: blue;
}
A data attribute is added to the root element in the example, and the same data attribute is added to the style block rules.
This works fine for the root element, but any nested element with the child
class does not properly get styled because the added data attribute interferes.
There two solutions I can think of would be to remove the data attribute or add it to every nested HTML element.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working