我正在尝试从Materail-UI按钮图像组件更改ImageBackground。问题在于CSS配置需要backgroundImage,但是它们是通过URL浏览器搜索的,而不是从我的文件系统文件夹中搜索的。
图片帮助链接:
; Functions
; }-----------------------------------------------------------------------{
GuiToggle()
{
Sleep, 50
WinGet, WinState, MinMax, ServiceDeskAssist
If(WinState==0||WinState==1)
{
Gui, -AlwaysOnTop
WinMinimize, ServiceDeskAssist
WinWaitNotActive, ServiceDeskAssist
}
else if(WinState==-1)
{
WinRestore, ServiceDeskAssist
WinActivate, ServiceDeskAssist
WinWaitActive, ServiceDeskAssist
Gui, +AlwaysOnTop
}
Sleep, 50
}
Toggle(a)
{
Sleep, 50
WinGet, WinState, MinMax, % a
If(WinState==0||WinState==1)
{
WinMinimize, % a
WinWaitNotActive, % a
}
else if(WinState==-1)
{
WinRestore, % a
WinActivate, % a
WinWaitActive, % a
}
Sleep, 50
}
; Hotkeys
; }-----------------------------------------------------------------------{
^x::ExitApp
^z::GuiToggle()
预期结果是从src映像通过文件系统文件夹本地资源管理器而不是通过url进行跨度搜索!
答案 0 :(得分:0)
您可以在ES5中这样做
<span
className={classes.imageSrc}
style={{
backgroundImage: `url(require("path to your image file"))`,
}}
/>
在ES6中,
import image from './image.jpg' //path to file
style={{backgroundImage : `url(${image})`}}