编程知识 cdmana.com

Less SCSS image path variable

scss

<style scoped lang="scss">
$ImgPath: "@/assets/img/";
.notFind {
    background: url(#{$ImgPath}404.jpg) center center no-repeat;
  }
</style>

less

<style scoped lang="less">
@ImgPath: "@/assets/img/";
.notFind {
    background: url(@{ImgPath}404.jpg) center center no-repeat;
  }
</style>

版权声明
本文为[qinghuo_]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225115027649i.html

Scroll to Top