1

我正在尝试在创建反应应用程序中使用顺风 css 将图像用作背景。但不知道如何添加背景图像类。

错误:

Module not found: Error: Can't resolve './src/images/pages/login.svg' in 'C:<some_project>\src'

我尝试了什么:

backgroundImage: {
      "login-image": "url('./src/images/pages/login.svg')",
},
// assumed it starts from src
backgroundImage: {
      "login-image": "url('/images/pages/login.svg')",
},
// also tried to place it into public page and include like
backgroundImage: {
      "login-image": "url('/images/pages/login.svg')",
},

任何帮助,将不胜感激!谢谢

4

0 回答 0