background: url(${@http}/img/icon/daorug@2x.png
) no-repeat center 3rem / auto 25%;
@http is a variable
It would be unrealistic to write it this way, and there would be no analysis!
Ask how to do?
淡淡烟草味2017-05-19 10:32:55
I found the answer, it should be background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
为情所困2017-05-19 10:32:55
The calling method is wrong, don’t use the dollar sign
@http: http://www.yoursite.com; // 对变量@http的定义, 习惯上写在less文件开头
background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;