scss文件里

:root {
    --height-primary: 240px;  //--height-primary  :变量名,css3有规则
}
$header: var(--height-primary); //用var来盛放变量名

.el-table{
    height: calc(100vh - 101px - #{$header});
}

 

js里更改

if(this.isDB){
       document.getElementsByTagName('body')[0].style.setProperty('--height-primary','64px');
 } else {
       document.getElementsByTagName('body')[0].style.setProperty('--height-primary','0px');
}

 

转 : https://www.jb51.cc/css/868154.html

https://www.cnblogs.com/llcdbk/p/14044176.html

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案