unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue

Home Page:https://www.npmjs.com/package/unplugin-vue-components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not importing <style></style> inside SFC file?

DouglasCalora opened this issue · comments

Clear and concise description of the problem

I have components that has <style> inside, this scss styles are not being imported, and there are no mention about it in documentation.

An example of component:

<template>
  <div aria-live="polite" class="qas-status" :class="backgroundClass" role="status" />
</template>

<script setup>
import { computed } from 'vue'

defineOptions({
  name: 'QasStatus',
  inheritAttrs: false
})

const props = defineProps({
  color: {
    type: String,
    default: 'light-blue-2'
  }
})

const backgroundClass = computed(() => `bg-${props.color}`)
</script>

<style lang="scss">
.qas-status {
  background-color: red;
  border-radius: 100%;
  height: 16px;
  width: 16px;
}
</style>

The styles of class qas-status are not being applied.

Suggested solution

What to do?

Alternative

No response

Additional context

No response

Validations

#794
I have same problem, no idea how to solve it.