build-a-hn-front-page icon indicating copy to clipboard operation
build-a-hn-front-page copied to clipboard

图片不显示,图片路径在浏览器里还是{imageLogo}

Open coder-yubin opened this issue 7 years ago • 0 comments

看了教程受益非浅,十分感谢!只是有个问题请教一下:我按照教程操作,可是图片路径就是没法正确显示,url-loader file-loader已安装,webpack.config.js也配置正确,请赐教! import React from "react";
import imageLogo from "./y18.gif";

export default class NewsHeader extends React.Component{
    getLogo(){
        return (
            <div className="newsHeader-logo">
                <a href="#"><img src={imageLogo} /></a>
            </div>
        );
    }
    getTitle(){
        return (
            <div className="newsHeader-title">
                <a class="newsHeader-textLink" href="#">Hacker News</a>
            </div>
        );
    }
    render(){
        return (
            <div className="NewsHeader">
            {this.getLogo()}
            {this.getTitle()}
            </div>
        );
    }
}

coder-yubin avatar Apr 18 '17 08:04 coder-yubin