0

我有一个使用 SASS 的 VS2019 项目,我对 SASS 一无所知(刚刚开始阅读有关它的内容)但我的一位同事注意到他在尝试编译该文件时遇到问题,而我没有知道问题出在哪里(检查了另一个使用该技术的解决方案,没有问题,项目在我看来是相同的)。

这里的项目结构:

在此处输入图像描述 在此处输入图像描述

main.scss(路径由 VS2019 使用拖放自动生成):

@import "../Content/bootstrap/bootstrap.scss";
@import "style.scss";

style.scss(用于测试@extend 命令的虚拟代码):

.row-box-ver .card-image, .row-box-ver .card-body, .row-box-ver .card-footer {
    @extend .text-secondary;
}

当我尝试编译 main.scss 时,出现此错误:

Error       ".row-box-ver .card-image" failed to @extend ".text-secondary".
The selector ".text-secondary" was not found.
Use "@extend .text-secondary !optional" if the extend should be able to fail.
C:\Users\MyUser\source\repos\MySolution\MyProject\Css\style.scss    3   

我不知道发生了什么,在我看来另一个项目工作正常,所以我不明白出了什么问题。

4

0 回答 0