react中引进图片的方法:1、方式一【import tsIcon from '../images/typescript.jpeg';】;2、方式二【const tsIcon = require( './images/typescrip】。
react中引进图片的方法:
方式一:
import tsIcon from '../images/typescript.jpeg';
方式二:
const tsIcon = require( '../images/typescript.jpeg');
使用方式一:
使用方式二:
使用方式三:
const styles = { test: { background: `url(${tsIcon}) no-repeat center` }}render() { return ( )}
上一篇:jquery怎样判断是否为空