[Vuejs]-How to get Component-scoped CSS WITHOUT using Single File Components?

-1👍

You could do style binding like so:

@Component({
  template: '<h1 :style="color: blue;">Not a Single File Component</h1>'
})

Alternatively, you could assign the h1 an id and reference the id in the stylesheet specifically.

@Component({
  template: '<h1 id="whatever-this-is">Not a Single File Component</h1>'
})

...

<style>
    #whatever-this-is {
        color: blue;
      }
</style>

Leave a comment