Skip to content

另外一种集成 micon的方案 #27

@tomnattle

Description

@tomnattle
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 };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions