Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/IronLu233/remax-iconfont
快速将Iconfont引入至Remax中
https://github.com/IronLu233/remax-iconfont
iconfont remaxjs
Last synced: about 15 hours ago
JSON representation
快速将Iconfont引入至Remax中
- Host: GitHub
- URL: https://github.com/IronLu233/remax-iconfont
- Owner: IronLu233
- Created: 2020-05-14T04:30:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T05:51:46.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T12:29:19.980Z (5 days ago)
- Topics: iconfont, remaxjs
- Language: TypeScript
- Homepage: https://codesandbox.io/s/remax-iconfont-demo-141sc
- Size: 2.58 MB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# remax-iconfont
在 Remax 项目中引入 Iconfont
### 使用
安装
```sh
yarn add remax-iconfont-component
yarn add -D remax-iconfont-plugin
```在 Iconfont 上找到你项目的 CSS
![image](https://user-images.githubusercontent.com/20639676/81887919-c9d3e780-95d2-11ea-8455-27a3cc6964a7.png)然后将插件加入到 `remax.config.js` 中
```js
const { RemaxIconfontPlugin } = require("remax-iconfont-plugin");
module.exports = {
plugins: [
RemaxIconfontPlugin({
// 将上面的CSS加入到此处
cssURL: "http://at.alicdn.com/t/font_8d5l8fzk5b87iudi.css",
}),
],
};
```最后在组件中这样使用
```jsx
import Icon from 'remax-iconfont-component';
const Foo = () =>
```