0
我有一個應用程序,我在數據庫中存儲圖像路徑。路徑是相對於我的文件系統而不是項目。ReactJS從項目外的文件系統加載圖像
當我問題陣營:
<img alt={this.props.alt} src={require('/fs/storage/images/logo.jpg')}/>
I'm收到以下錯誤:
You attempted to import /fs/storage/images/logo.jpg which falls outside of the project
src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules.
我該如何解決呢?我應該在哪裏放置該消息所建議的符號鏈接?
*的JavaScript。 –