Skip to content

Commit 3fbb2b5

Browse files
committed
docs: update 3.x version
1 parent 09ec4f7 commit 3fbb2b5

File tree

285 files changed

+9785
-9023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+9785
-9023
lines changed

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm commitlint --edit $1 --config commitlint.config.js

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm lint-staged --allow-empty

docs/GETTING-STARTED.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ $ cnpm install -g @tarojs/cli
2727
```bash
2828
$ npm install -g mirror-config-china
2929
```
30+
3031
:::
3132

3233
#### 查看 Taro 全部版本信息
@@ -117,9 +118,10 @@ $ NODE_ENV=production taro build --type weapp --watch # Bash
117118
下载并打开[微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html),然后选择**项目根目录**进行预览。
118119

119120
需要注意开发者工具的项目设置:
120-
* 需要设置关闭 ES6 转 ES5 功能,开启可能报错
121-
* 需要设置关闭上传代码时样式自动补全,开启可能报错
122-
* 需要设置关闭代码压缩上传,开启可能报错
121+
122+
- 需要设置关闭 ES6 转 ES5 功能,开启可能报错
123+
- 需要设置关闭上传代码时样式自动补全,开启可能报错
124+
- 需要设置关闭代码压缩上传,开启可能报错
123125

124126
### 百度小程序
125127

@@ -152,9 +154,10 @@ $ NODE_ENV=production taro build --type swan --watch # Bash
152154
下载并打开[百度开发者工具](https://smartprogram.baidu.com/docs/develop/devtools/show_sur/),并确保已经设置了小程序项目配置文件 [project.swan.json](./project-config)。然后选择项目根目录下 `dist` 目录(根目录 `config` 中的 `outputRoot` 设置的目录)进行预览。
153155

154156
需要注意开发者工具的项目设置:
155-
* 需要关闭 ES6 转 ES5 功能,开启可能报错
156-
* 需要关闭上传代码时样式自动补全,开启可能报错
157-
* 需要关闭代码压缩上传,开启可能报错
157+
158+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
159+
- 需要关闭上传代码时样式自动补全,开启可能报错
160+
- 需要关闭代码压缩上传,开启可能报错
158161

159162
### 支付宝小程序
160163

@@ -187,9 +190,10 @@ $ NODE_ENV=production taro build --type alipay --watch # Bash
187190
下载并打开[支付宝小程序开发者工具](https://docs.alipay.com/mini/developer/getting-started/),然后选择项目根目录下 `dist` 目录(根目录 `config` 中的 `outputRoot` 设置的目录)进行预览。
188191

189192
需要注意开发者工具的项目设置:
190-
* 需要关闭 ES6 转 ES5 功能,开启可能报错
191-
* 需要关闭上传代码时样式自动补全,开启可能报错
192-
* 需要关闭代码压缩上传,开启可能报错
193+
194+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
195+
- 需要关闭上传代码时样式自动补全,开启可能报错
196+
- 需要关闭代码压缩上传,开启可能报错
193197

194198
### 字节跳动小程序
195199

@@ -222,9 +226,10 @@ $ NODE_ENV=production taro build --type tt --watch # Bash
222226
下载并打开[字节跳动小程序开发者工具](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/developer-instrument/download/developer-instrument-update-and-download/),并确保已经设置了小程序项目配置文件 [project.tt.json](./project-config)。然后选择项目根目录下 `dist` 目录(根目录 `config` 中的 `outputRoot` 设置的目录)进行预览。
223227

224228
需要注意开发者工具的项目设置:
225-
* 需要关闭 ES6 转 ES5 功能,开启可能报错
226-
* 需要关闭上传代码时样式自动补全,开启可能报错
227-
* 需要关闭代码压缩上传,开启可能报错
229+
230+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
231+
- 需要关闭上传代码时样式自动补全,开启可能报错
232+
- 需要关闭代码压缩上传,开启可能报错
228233

229234
### QQ 小程序
230235

@@ -257,9 +262,10 @@ $ NODE_ENV=production taro build --type qq --watch # Bash
257262
下载并打开 [QQ 小程序开发者工具](https://q.qq.com/wiki/#_4-%E7%BC%96%E7%A0%81%E5%BC%80%E5%8F%91%E5%B0%8F%E7%A8%8B%E5%BA%8F),然后选择项目根目录下 `dist` 目录(根目录 `config` 中的 `outputRoot` 设置的目录)进行预览。
258263

259264
需要注意开发者工具的项目设置:
260-
* 需要关闭 ES6 转 ES5 功能,开启可能报错
261-
* 需要关闭上传代码时样式自动补全,开启可能报错
262-
* 需要关闭代码压缩上传,开启可能报错
265+
266+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
267+
- 需要关闭上传代码时样式自动补全,开启可能报错
268+
- 需要关闭代码压缩上传,开启可能报错
263269

264270
### 京东小程序
265271

@@ -292,9 +298,10 @@ $ NODE_ENV=production taro build --type jd --watch # Bash
292298
下载并打开京东小程序开发者工具(前往https://mp.jd.com 注册,申请成功后将会获得开发者工具),然后选择项目根目录下 `dist` 目录(根目录 `config` 中的 `outputRoot` 设置的目录)进行预览。
293299

294300
需要注意开发者工具的项目设置:
295-
* 需要关闭 ES6 转 ES5 功能,开启可能报错
296-
* 需要关闭上传代码时样式自动补全,开启可能报错
297-
* 需要关闭代码压缩上传,开启可能报错
301+
302+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
303+
- 需要关闭上传代码时样式自动补全,开启可能报错
304+
- 需要关闭代码压缩上传,开启可能报错
298305

299306
#### 京东小程序相关阅读
300307

@@ -320,9 +327,7 @@ yarn add @tarojs/plugin-platform-weapp-qy
320327
```js title="Taro 项目配置"
321328
config = {
322329
// ...
323-
plugins: [
324-
'@tarojs/plugin-platform-weapp-qy'
325-
]
330+
plugins: ['@tarojs/plugin-platform-weapp-qy'],
326331
}
327332
```
328333

@@ -379,9 +384,7 @@ yarn add @tarojs/plugin-platform-alipay-dd
379384
```js title="Taro 项目配置"
380385
config = {
381386
// ...
382-
plugins: [
383-
'@tarojs/plugin-platform-alipay-dd'
384-
]
387+
plugins: ['@tarojs/plugin-platform-alipay-dd'],
385388
}
386389
```
387390

@@ -432,9 +435,7 @@ yarn add @tarojs/plugin-platform-alipay-iot
432435
```js title="Taro 项目配置"
433436
config = {
434437
// ...
435-
plugins: [
436-
'@tarojs/plugin-platform-alipay-iot'
437-
]
438+
plugins: ['@tarojs/plugin-platform-alipay-iot'],
438439
}
439440
```
440441

@@ -485,9 +486,7 @@ yarn add @tarojs/plugin-platform-lark
485486
```js title="Taro 项目配置"
486487
config = {
487488
// ...
488-
plugins: [
489-
'@tarojs/plugin-platform-lark'
490-
]
489+
plugins: ['@tarojs/plugin-platform-lark'],
491490
}
492491
```
493492

@@ -516,10 +515,12 @@ $ NODE_ENV=production taro build --type lark --watch # Bash
516515
```
517516

518517
#### 小程序开发者工具
519-
[飞书小程序](https://open.feishu.cn/document/uYjL24iN/uMjNzUjLzYzM14yM2MTN?from=taro)能运行在飞书客户端上,且一套代码多端运行(包括PC端和移动端)。你需要下载并打开[飞书小程序开发者工具](https://open.feishu.cn/document/uYjL24iN/ucDOzYjL3gzM24yN4MjN?from=taro),并确保已经设置了小程序项目配置文件。然后选择项目根目录下 `dist` 目录进行预览。
518+
519+
[飞书小程序](https://open.feishu.cn/document/uYjL24iN/uMjNzUjLzYzM14yM2MTN?from=taro)能运行在飞书客户端上,且一套代码多端运行(包括 PC 端和移动端)。你需要下载并打开[飞书小程序开发者工具](https://open.feishu.cn/document/uYjL24iN/ucDOzYjL3gzM24yN4MjN?from=taro),并确保已经设置了小程序项目配置文件。然后选择项目根目录下 `dist` 目录进行预览。
520520

521521
需要注意开发者工具的项目配置
522-
- 需要关闭ES6转ES5功能,开启可能报错
522+
523+
- 需要关闭 ES6 转 ES5 功能,开启可能报错
523524
- 需要关闭上传代码时样式自动补全,开启可能报错
524525
- 需要关闭代码压缩上传,开启可能报错
525526

@@ -551,9 +552,7 @@ yarn add @tarojs/plugin-platform-kwai
551552
```js title="Taro 项目配置"
552553
config = {
553554
// ...
554-
plugins: [
555-
'@tarojs/plugin-platform-kwai'
556-
]
555+
plugins: ['@tarojs/plugin-platform-kwai'],
557556
}
558557
```
559558

@@ -632,10 +631,11 @@ $ taro update self
632631
# 使用Taro 升级命令更新CLI版本到指定版本
633632
$ taro update self [版本号]
634633
# 使用Taro 升级命令将项目依赖升级到与@tarojs/cli一致的版本
635-
$ taro update project
634+
$ taro update project
636635
# 使用Taro 升级命令将项目依赖升级到指定版本
637636
$ taro update project [版本号]
638637
```
638+
639639
如果你所使用的 Taro CLI 版本为 3.0.9,而项目里使用的依赖版本为 3.0.10,则有可能会出现问题,这时请将你的 Taro CLI 版本更新至项目依赖版本号相同的版本,如果还是出现问题,请向我们提出 [Issue](https://nervjs.github.io/taro-issue-helper/)
640640

641641
### Taro 多版本共存问题

docs/README.mdx

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
title: Taro 介绍
33
---
44

5-
import Tabs from '@theme/Tabs'
5+
import Link from '@docusaurus/Link'
66
import TabItem from '@theme/TabItem'
7-
import { VueIcon, ReactIcon } from './guides/index'
7+
import Tabs from '@theme/Tabs'
8+
9+
import { ReactIcon, VueIcon } from './guides/index'
810
import News from './news'
911

1012
## 简介
@@ -56,18 +58,18 @@ import { View, Text } from '@tarojs/components'
5658

5759
export default class Index extends Component {
5860
state = {
59-
msg: 'Hello World!'
61+
msg: 'Hello World!',
6062
}
6163

62-
componentWillMount () { }
64+
componentWillMount() {}
6365

64-
componentDidShow () { }
66+
componentDidShow() {}
6567

66-
componentDidHide () { }
68+
componentDidHide() {}
6769

68-
render () {
70+
render() {
6971
return (
70-
<View className='index'>
72+
<View className="index">
7173
<Text>{this.state.msg}</Text>
7274
</View>
7375
)
@@ -87,16 +89,16 @@ export default class Index extends Component {
8789
</template>
8890

8991
<script>
90-
export default {
91-
data () {
92-
return {
93-
msg: 'Hello World!'
94-
}
95-
},
96-
created () {},
97-
onShow () {},
98-
onHide () {}
99-
}
92+
export default {
93+
data() {
94+
return {
95+
msg: 'Hello World!',
96+
}
97+
},
98+
created() {},
99+
onShow() {},
100+
onHide() {},
101+
}
100102
</script>
101103
```
102104

@@ -127,7 +129,7 @@ export default {
127129

128130
[【教程】5 分钟上手 Taro 开发](/docs/guide)
129131

130-
[【视频】5分钟快速上手 Taro 开发小程序](https://mp.weixin.qq.com/s?__biz=MzU3NDkzMTI3MA==&mid=2247484205&idx=1&sn=935bb7a35c11c33563eeb7c3aaca3321&chksm=fd2bab04ca5c2212b4cd8aeb5858bd08517aeb31e20727b22d1eee00b394184e7e61359e7dd9&token=1180618535&lang=zh_CN#rd)
132+
[【视频】5 分钟快速上手 Taro 开发小程序](https://mp.weixin.qq.com/s?__biz=MzU3NDkzMTI3MA==&mid=2247484205&idx=1&sn=935bb7a35c11c33563eeb7c3aaca3321&chksm=fd2bab04ca5c2212b4cd8aeb5858bd08517aeb31e20727b22d1eee00b394184e7e61359e7dd9&token=1180618535&lang=zh_CN#rd)
131133

132134
[【掘金小册】Taro 多端开发实现原理与实战](https://juejin.im/book/5b73a131f265da28065fb1cd?referrer=5ba228f16fb9a05d3251492d)
133135

@@ -141,14 +143,4 @@ Taro 已经投入了我们的生产环境中使用,业界也在广泛地使用
141143

142144
[我们正在征集更多优秀案例,欢迎点击提交](https://github.com/NervJS/taro/issues/244)
143145

144-
<a href="https://nervjs.github.io/taro-user-cases/"><img src="https://raw.githubusercontent.com/NervJS/taro-user-cases/master/user-cases.jpg" /></a>
145-
146-
import Link from '@docusaurus/Link';
147-
148-
149-
150-
151-
152-
153-
154-
146+
![[](https://nervjs.github.io/taro-user-cases/)](https://raw.githubusercontent.com/NervJS/taro-user-cases/master/user-cases.jpg)

0 commit comments

Comments
 (0)