Skip to content

css module doesnt work in Vue3 #1288

@xiaolinsq

Description

@xiaolinsq

Bug report

Packages affected

  • sandpack-client
  • [✅ ] sandpack-react

Description of the problem

When using CSS Modules in Vue 3 Single File Component with <style module>, the $style object is not applied to the template. The class binding :class="$style.hello" doesn't work as expected.

<template>
  <div :class="$style.hello">
    HelloWorld
  </div>
</template>

<script>
export default {}
</script>

<style module>
.hello {
  font-size: 16px;
  color: red;
}
</style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions