Home  >  Q&A  >  body text

javascript - webpack中less文件路径该怎么设置

在vue-cli脚手架中,我使用less设置背景图片,但是遇到了一个问题,背景图片路径被莫名其妙的变成了less文件所在的路径而不是header.vue组件所在的路径

PHP中文网PHP中文网2741 days ago623

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-18 10:58:14

    There is a problem with the path of the image you set,

    Now you still put the image in the header folder, change the path

    background-image:url("../../componments/header"+"@{img}@2.x.png")

    reply
    0
  • Cancelreply