/*上网搜索了好多方法,最终只有这一种比较适合*/

参考:

https://blog.csdn.net/weixin_44392565/article/details/85755592
https://www.cnblogs.com/asds/p/6148680.html

1、在test.scss文件里

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

在main.js里更改或是你需要的地方更改

if(process.env.NODE_ENV == 'production') document.getElementsByTagName('body')[0].style.setProperty('--width-primary','0px');

 

 

 

相关文章:

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