Ali's father react when using iconfont, does not show the problem

Choose to use Unicodewhen:

  • Follows normal use, the display is normal:
<i className="iconfont">&#xe600;</i>
  • When using the map to cycle, you need to be original &#xe600;, into\ue600

Specific reasons: View other bloggers online, did not see a reasonable explanation, as currently understood, needs to be escaped

let otherStyle=[{
            icon:'\ue7e5',
            name:'微信'
        },{
            icon:'\ue666',
            name:'QQ'
        },{
            icon:'\ue62a',
            name:'新浪微博'
        },{
            icon:'\ue600',
            name:'网易邮箱'
        }]
        let otherLoginStyle=otherStyle.map((item,index)=>{
            return(
                <div onClick={()=>this.otherLoginStyle()} key={index}>
                    <div className="login-border">
                        <i className="iconfont login-icon1">{item.icon}</i>
                    </div>
                    <div>{item.name}</div>
                </div> 
            )
        })

Guess you like

Origin www.cnblogs.com/zdping/p/11499135.html