Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMG标签src 图片资源定位问题 #81

Open
mcjing opened this issue Jun 11, 2018 · 1 comment
Open

IMG标签src 图片资源定位问题 #81

mcjing opened this issue Jun 11, 2018 · 1 comment

Comments

@mcjing
Copy link

mcjing commented Jun 11, 2018

使用NERVJS 框架
在JSX中IMG标签引入图片,图片无法预览,好像是没有引用的问题,在CSS中应用的背景图片就可以访问的到?
请问这种要怎么解决或者要怎么写
image
image

@luckyadam
Copy link
Member

要使用 import 或者 require 引用一下图片资源,然后再使用

import xx from './images/bg.jpg'

<img src={xx} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants