background: url(${@http}/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
${@http}/img/icon/daorug@2x.png
@http是變數這樣書寫會不現實,也沒有解析!
請問該怎麼辦?
ringa_lee
找到答案了 應該是background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
呼叫方式錯了,不用那個美元符號
@http: http://www.yoursite.com; // 对变量@http的定义, 习惯上写在less文件开头 background: url(@http/img/icon/daorug@2x.png) no-repeat center 3rem / auto 25%;
找到答案了 應該是
background: url('@{http}/img/icon/daorug@2x.png') no-repeat center 3rem / auto 25%;
呼叫方式錯了,不用那個美元符號