Jeepeng/taro-icons

另外一种集成 micon的方案

Opened this issue · 0 comments

yarn add material-design-icons
// index.tsx
import "material-design-icons/iconfont/material-icons.css";

// util/icon.tsx
import { Text } from "@tarojs/components";

const MIcon = ({ name, color = PRIMARY_COLOR, size = 24 }: any) => <Text className='material-icons' style={{
  color: color,
  fontSize: size,
  width: size
}}
>{(name || '').replace(/-/g, '_')}</Text>

export { MIcon };