Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tomnattle opened this issue Feb 7, 2023 · 0 comments
Open

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

tomnattle opened this issue Feb 7, 2023 · 0 comments

Comments

@tomnattle
Copy link

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 };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant