Skip to content

Commit 600f0f7

Browse files
committed
doc: Update getting started document.
1 parent d6f2b38 commit 600f0f7

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

website/src/pages/docs/development/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ website
103103
│   └── router.tsx # 配置菜单对应的页面
104104
```
105105

106-
#### `1. 菜单配置`
106+
#### `第 1 步:菜单配置`
107107

108108
[`website/src/routes/menus.ts`](https://github.com/uiwjs/react-native-uiw/blob/4e4f55681a71b4813a5f5fe26f4b1a859bc85a7f/website/src/routes/menus.ts#L44) 中配置菜单
109109

@@ -125,7 +125,7 @@ export const docsMenus: MenuData[] = [
125125
export const componentMenus: MenuData[] = [ .... ]
126126
```
127127

128-
#### `2. 新增路由`
128+
#### `第 2 步:新增路由`
129129

130130
[`website/src/routes/router.tsx`](https://github.com/uiwjs/react-native-uiw/blob/4e4f55681a71b4813a5f5fe26f4b1a859bc85a7f/website/src/routes/router.tsx#L39-L41) 中加载 Markdown 以及相关文件
131131

@@ -141,7 +141,7 @@ export const getRouterData = {
141141
}
142142
```
143143

144-
#### `3. 新增 Markdown 文件`
144+
#### `第 3 步:新增 Markdown 文件`
145145

146146
添加 `website/src/pages/docs/getting-started/README.md``website/src/pages/docs/getting-started/index.tsx`
147147

website/src/pages/docs/environment-setup/ios/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,18 @@ npx react-native init AwesomeProject --version X.XX.X
8383
npx react-native init AwesomeTSProject --template react-native-template-typescript
8484
```
8585

86+
您还可以使用我们制定的模版([`@uiw/react-native-template`](https://github.com/uiwjs/react-native-template))创建一个新项目:
87+
88+
<!--rehype:style=background-color: rgb(118 247 149);-->
89+
```shell
90+
npx react-native init AwesomeProject --template @uiw/react-native-template
91+
```
92+
8693
> ⚠️ 注意:如果上述命令失败,您可能在您的 PC 上全局安装了旧版本的 react-native 或 react-native-cli。 尝试卸载 `cli` 并使用 `npx` 运行 cli。
8794
<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->
8895
8996
## 运行你的 React Native 应用程序
9097

91-
9298
### `第 1 步:启动 Metro`
9399

94100
首先,您需要启动 `Metro`,这是 `React Native` 附带的 `JavaScript` 打包器。 Metro “接收一个入口文件和各种选项,并返回一个包含所有代码及其依赖项的 JavaScript 文件。” —— [Metro Docs](https://facebook.github.io/metro/docs/concepts)

website/src/pages/docs/getting-started/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,33 @@
44
项目基于 node,请确保已具备较新的 node 环境(>=12.0.0),推荐使用 node 版本管理工具 [nvm](https://github.com/creationix/nvm) 或者 [`n`](https://github.com/tj/n) 来管理 node,这样不仅可以很方便地切换 node 版本,而且全局安装时候也不用加 sudo 了。
55

66
> ⚠️ [react-native](https://github.com/facebook/react-native) v60+
7+
<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->
8+
9+
10+
### `使用特定版本或模板`
11+
12+
如果你想用特定的 React Native 版本开始一个新项目,你可以使用 `--version` 参数:
13+
14+
```bash
15+
npx react-native init AwesomeProject --version X.XX.X
16+
```
17+
18+
您还可以使用自定义 React Native 模板(如 TypeScript)使用 `--template` 参数启动项目:
19+
20+
```bash
21+
npx react-native init AwesomeTSProject --template react-native-template-typescript
22+
```
23+
24+
您还可以使用我们制定的模版([`@uiw/react-native-template`](https://github.com/uiwjs/react-native-template))创建一个新项目:
25+
26+
<!--rehype:style=background-color: rgb(118 247 149);-->
27+
```shell
28+
npx react-native init AwesomeProject --template @uiw/react-native-template
29+
```
30+
31+
> ⚠️ 注意:如果上述命令失败,您可能在您的 PC 上全局安装了旧版本的 react-native 或 react-native-cli。 尝试卸载 `cli` 并使用 `npx` 运行 cli。
32+
<!--rehype:style=border-left: 8px solid #ffe564;background-color: #ffe56440;padding: 12px 16px;-->
33+
734

835
## Install
936

0 commit comments

Comments
 (0)