我已将基本名称更改为'/ test'
现在我无法打开同一文件夹中的本地图像
history.ts
import { History, createBrowserHistory } from 'history';
export const history: History = createBrowserHistory({
basename: '/test'
});
从home.tsx(这不起作用)
<img width="100%" height="600px" alt="" src="./image.jpg" />
如何确定本地图像也将使用基本图像
我找到了2种可能的解决方案
使用要求
<img width="100%" height="600px" alt="" src="{require("./image.jpg")}" />
用start_url="/basename"
]更新manifest.json>
将"hompage":"/basename"
添加到package.json