我使用官方文档提供的配置sass全局变量,但是报错!
‘;’还有官方强调的“~”都没落;
vue.config.js代码如下:
module.exports = {
css: {
loaderOptions: {
sass: {
data: `@import "~@/assets/scss/variables.scss";`,
},
}
}
}
variables.scss的代码如下:
$color:#fff;
组件代码如下:
// $tcolor:red;
.title{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 40px;
background-color: cornflowerblue;
} .title p {
width: 100%;
height: 100%;
line-height: 40px;
text-align: center;
font-size: 20px;
color: $color;
}
报错内容如下:
error in ./src/components/header.vue?vue&type=style&index=0&lang=scss&am