在.vue文件中,有3部分:

vue中的script/css配置

在css中scoped表示作用域,加上表示只作用于此组件上;                                                                                                            如果想用less、scss等来编写,可以加 lang="scss"                                                                                                                      注意在webstrom中再style中写scss,会出现红色提示曲线,加上type="text/scss"可以解决

<style  lang="scss" scoped type="text/scss">
 body {
   div{
     font-size: 12px;
     p{
       color: blue;
     }
   }
 }
</style>

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2022-02-28
  • 2021-12-27
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案