[Vuejs]-How to use variable declared in scss file in functions of a .vue file?

0👍

According to docs you should be able to access variable in style tags not in javascript.

<template>
  <div>
    <h1>Hello world</h1>
  </div>
</template>

<script>
  export default {
    mounted(){
    }
  }
</script>

<style lang="scss">
  div h1 {
    background-color: $primary;
  }
</style>

Leave a comment