解决scss文件嵌套样式无效

页面引用

1.安装:

npm install sass -D

2.新建style.scss文件

.page{
    
    
  color: #ffffff;
  .page--header{
    
    
    height:55px;
  }
}

3.页面引用

<style lang="scss" scoped>
@import url("style.scss");
</style>

出现问题:嵌套page–header样式无效!!!

解决方法

改写页面引用方法:

<style lang="scss" scoped>
@import "./style.scss";
</style>

或者

<style lang="scss"  src="./style.scss"></style>

猜你喜欢

转载自blog.csdn.net/qq_34661750/article/details/119541429
今日推荐