I've recently started using Vue.js 2, and I'm a fan of the single-file component structure:
<template>
<h1>Hello World</h1>
</template>
<script>
export default {
name: 'hello-world',
};
</script>
<style scoped lang="scss">
h1 {
font-size: 72px;
}
</style>
I'm curious if there's an established way to pass variables between SCSS and JS, though. I need to share a value, and right now it's duplicated in both sections.
I used the Vue CLI to create this project, so it's being bundled with Webpack 2, using the vue-loader. I'm hoping there's a way to configure it to populate variables from JS to SCSS, or vice-versa.