Skip to content

Component styles doesn't work if there is more than one div inside template #105

@futurfuturfuturfutur

Description

@futurfuturfuturfutur

I am using Preview component with Vue 3. And if I pass this code, there is no styles applied.

<template>
  <div class="test">Test</div>
  <div class="test2">Test2</div>

</template>

<script setup></script>

<style>
.test {
  width: 100px;
  height: 100px;
  background: red;
}
.test2 {
  width: 50px;
  height: 50px;
  background: green;
}
</style>

What I am getting as a result:
image
Tried this code also on demo page http://vue-live.surge.sh/, same result:
image

And what is interesting, if there is only one div inside template, it works:
image
image

As I can see after compile there is no scope data attribute applied to dives if there is more than one div inside template
Two dives:
image
One div:
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions