【发布时间】:2021-12-31 02:59:31
【问题描述】:
你好,我正在做这个电子项目,我遇到了这个问题,当我给出这条路径时
`file://${path.join(__dirname, `../build/index.html#/view/${arg}`)}`
我希望如此,
file:///C:/Users/admin/AppData/Local/Programs/electrondesktop/resources/app.asar/build/index.html#/view/61995a6fcf31f7cddedcce59
相反,我明白了,
file:///C:/Users/admin/AppData/Local/Programs/electrondesktop/resources/app.asar/build/index.html#\view\61995a6fcf31f7cddedcce59
请注意在井号 (#) 符号之后正斜杠 ("/") 如何变为反斜杠 ("\")
index.html#/view/61995a6fcf31f7cddedcce59
index.html#\view\61995a6fcf31f7cddedcce59
我该如何解决这个问题?
我正在使用带有反应 btw 的电子。
【问题讨论】:
-
arg 只是一个包含这个值“61995a6fcf31f7cddedcce59”的变量,它还能工作吗? @pilchard
-
嗯,那么不确定。无法在特定于 Windows 的 MacOS 上重现此行为?
-
Windows @pilchard
-
试过了,一点帮助都没有。必须有某种解决方案。 @pilchard
标签: javascript html node.js reactjs electron