Skip to content

Commit

Permalink
update READEM.md(Link icon fonts)
Browse files Browse the repository at this point in the history
  • Loading branch information
1uokun committed Apr 8, 2024
1 parent 6dec0d2 commit f571cb7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,18 @@ yarn add @react-native-community/segmented-control @react-native-community/slide
### Link icon fonts

```js
// config `react-native.config.js` in project’s root directory
module.exports = {
assets: ['node_modules/@ant-design/icons-react-native/fonts'],
};
```
then
```bash
npx react-native link
npx react-native-asset
```

[introduce](docs/react/introduce.en-US.md#安装)
[introduce](docs/react/introduce.en-US.md#2-installation)

## Links

Expand Down
16 changes: 12 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,22 @@ yarn add @react-native-community/segmented-control @react-native-community/slide

> 安装完依赖后需要到 iOS 目录 `pod install`(auto linking),Android 不需要手动处理
### 链接字体图标以及自动链接
### 链接字体图标


```js
// 配置根目录下的 `react-native.config.js` 文件
module.exports = {
assets: ['node_modules/@ant-design/icons-react-native/fonts'],
};
```
然后
```bash
# 手动链接字体图标
npx react-native link
# 手动执行命令
npx react-native-asset
```

[介绍](docs/react/introduce.zh-CN.md#安装)
[介绍](docs/react/introduce.zh-CN.md#2-安装)

## 链接

Expand Down
14 changes: 13 additions & 1 deletion docs/react/introduce.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,21 @@ or
$ yarn add @ant-design/icons-react-native
```

<br/>
Add assets to your `react-native.config.js` ( If not exist, please create in project’s root directory )

```js
module.exports = {
assets: ['node_modules/@ant-design/icons-react-native/fonts'],
};
```

Run the [`react-native-asset`](https://github.com/unimonkiez/react-native-asset)'s command and linking + unlinking is automatic

```bash
$ npx react-native link @ant-design/icons-react-native
npx react-native-asset
```
<br/>

> If you are using expo please make sure fonts has been loaded
Expand Down
15 changes: 14 additions & 1 deletion docs/react/introduce.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,22 @@ or
$ yarn add @ant-design/icons-react-native
```

<br/>

将字体资源路径配置到根目录下的 `react-native.config.js` 文件中 ( 如果没有,请创建 )

```js
module.exports = {
assets: ['node_modules/@ant-design/icons-react-native/fonts'],
};
```

然后执行[`react-native-asset`](https://github.com/unimonkiez/react-native-asset)的命令

```bash
$ npx react-native link @ant-design/icons-react-native
npx react-native-asset
```
<br/>

> 如果你用的是 expo 请确保字体已经加载完成再初始化 app
Expand Down

0 comments on commit f571cb7

Please sign in to comment.