react 中引入font-awesome

1.react

https://www.npmjs.com/package/react-fontawesomenpm

npm install --save react-fontawesome   //這裏不包含樣式,須要引入font-awesome的樣式less

 

2.
npm install font-awesome //爲了用他的樣式

3.

import React, { Component } from 'react';
import './index.less';

import 'font-awesome/less/font-awesome.less';
import 'react-fontawesome';spa

4.code

<i class="fa fa-camera-retro"></i>class

相關文章
相關標籤/搜索