Closed
Description
export.scss
$text-color: #7f848e;
$text-color-highlight: #cccccc;
:export {
textColor: $text-color;
textColorHightlight: $text-color-highlight;
}
Vite & Vue 3, App.vue
import scssVariables from 'export.scss'
setup() {
const scss = ref(scssVariables)
console.log(scss.value)
return {
scss
}
}
console
:export {
textColor: #7f848e;
textColorHightlight: #cccccc;
}
the result of scss
is a String type, not an Object.
its work fine in vue2.x, scss
returns an Object, can directly use scss.textColor
to get the variable in <script>
or <template>
.
I haven't tested the results in Vue3 without vite, but I think it should because vite.
Activity
yyx990803 commentedon Jan 2, 2021
Probably not going to support anything beyond current pre-processor support scope. Use CSS modules instead.
Shinigami92 commentedon Aug 10, 2022
Solution: #9601