From edbdbe753579f09ce270bfeb6ae5df055887a34e Mon Sep 17 00:00:00 2001 From: Pines-Cheng <spider.cs.nuc@gmail.com> Date: Mon, 26 Aug 2019 20:43:41 +0800 Subject: [PATCH] docs: update v1.3.15 --- .../version-1.3.15/GETTING-STARTED.md | 364 ++++++++++ .../version-1.3.15/components/open/ad.md | 39 ++ .../components/open/official-account.md | 36 + .../components/open/open-data.md | 35 + .../version-1.3.15/components/open/others.md | 21 + website/versioned_docs/version-1.3.15/size.md | 169 +++++ .../version-1.3.15-sidebars.json | 632 ++++++++++++++++++ website/versions.json | 1 + 8 files changed, 1297 insertions(+) create mode 100644 website/versioned_docs/version-1.3.15/GETTING-STARTED.md create mode 100644 website/versioned_docs/version-1.3.15/components/open/ad.md create mode 100644 website/versioned_docs/version-1.3.15/components/open/official-account.md create mode 100644 website/versioned_docs/version-1.3.15/components/open/open-data.md create mode 100644 website/versioned_docs/version-1.3.15/components/open/others.md create mode 100644 website/versioned_docs/version-1.3.15/size.md create mode 100644 website/versioned_sidebars/version-1.3.15-sidebars.json diff --git a/website/versioned_docs/version-1.3.15/GETTING-STARTED.md b/website/versioned_docs/version-1.3.15/GETTING-STARTED.md new file mode 100644 index 000000000000..70c71b29f4cd --- /dev/null +++ b/website/versioned_docs/version-1.3.15/GETTING-STARTED.md @@ -0,0 +1,364 @@ +--- +title: 安装及使用 +id: version-1.3.15-GETTING-STARTED +original_id: GETTING-STARTED +--- + +## 安装 + +Taro 项目基于 node,请确保已具备较新的 node 环境(>=8.0.0),推荐使用 node 版本管理工具 [nvm](https://github.com/creationix/nvm) 来管理 node,这样不仅可以很方便地切换 node 版本,而且全局安装时候也不用加 sudo 了。 + +### cli 工具安装 + +首先,你需要使用 npm 或者 yarn 全局安装`@tarojs/cli`,或者直接使用[npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b): + +```bash +# 使用 npm 安装 CLI +$ npm install -g @tarojs/cli +# OR 使用 yarn 安装 CLI +$ yarn global add @tarojs/cli +# OR 安装了 cnpm,使用 cnpm 安装 CLI +$ cnpm install -g @tarojs/cli +``` + +## 回到某个版本 + +需要安装某个固定版本,或者回到某个版本,例如我们要安装 `1.3.9` , 则如下: + +```bash +# 使用 npm 安装 CLI +$ npm install -g @tarojs/cli@1.3.9 +# OR 使用 yarn 安装 CLI +$ yarn global add @tarojs/cli@1.3.9 +# OR 安装了 cnpm,使用 cnpm 安装 CLI +$ cnpm install -g @tarojs/cli@1.3.9 +``` + +### 注意事项 + +值得一提的是,如果安装过程出现`sass`相关的安装错误,请在安装[`mirror-config-china`](https://www.npmjs.com/package/mirror-config-china)后重试。 + +```bash +$ npm install -g mirror-config-china +``` + +## 使用 + +使用命令创建模板项目 + +```bash +$ taro init myApp +``` + +npm 5.2+ 也可在不全局安装的情况下使用 npx 创建模板项目 + +```bash +$ npx @tarojs/cli init myApp +``` + + + +在创建完项目之后,Taro 会默认开始安装项目所需要的依赖,安装使用的工具按照 yarn>cnpm>npm 顺序进行检测,一般来说,依赖安装会比较顺利,但某些情况下可能会安装失败,这时候你可以在项目目录下自己使用安装命令进行安装 + +```bash +# 使用 yarn 安装依赖 +$ yarn +# OR 使用 cnpm 安装依赖 +$ cnpm install +# OR 使用 npm 安装依赖 +$ npm install +``` + +进入项目目录开始开发,目前已经支持 微信/百度/支付宝/字节跳动/QQ 小程序、H5、快应用以及 ReactNative 等端的代码转换,针对不同端的启动以及预览、打包方式并不一致 + +### 微信小程序 + +选择微信小程序模式,需要自行下载并打开[微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html),然后选择项目根目录进行预览。 + +微信小程序编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:weapp +$ yarn build:weapp +# npm script +$ npm run dev:weapp +$ npm run build:weapp +# 仅限全局安装 +$ taro build --type weapp --watch +$ taro build --type weapp +# npx 用户也可以使用 +$ npx taro build --type weapp --watch +$ npx taro build --type weapp +``` + +### 百度小程序 + +选择百度小程序模式,需要自行下载并打开[百度开发者工具](https://smartprogram.baidu.com/docs/develop/devtools/show_sur/),然后在项目编译完后选择项目根目录下 `dist` 目录进行预览。 + +百度小程序编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:swan +$ yarn build:swan +# npm script +$ npm run dev:swan +$ npm run build:swan +# 仅限全局安装 +$ taro build --type swan --watch +$ taro build --type swan +# npx 用户也可以使用 +$ npx taro build --type swan --watch +$ npx taro build --type swan +``` + +### 支付宝小程序 + +选择支付宝小程序模式,需要自行下载并打开[支付宝小程序开发者工具](https://docs.alipay.com/mini/developer/getting-started/),然后在项目编译完后选择项目根目录下 `dist` 目录进行预览。 + +支付宝小程序编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:alipay +$ yarn build:alipay +# npm script +$ npm run dev:alipay +$ npm run build:alipay +# 仅限全局安装 +$ taro build --type alipay --watch +$ taro build --type alipay +# npx 用户也可以使用 +$ npx taro build --type alipay --watch +$ npx taro build --type alipay +``` + +### 字节跳动小程序 + +选择字节跳动小程序模式,需要自行下载并打开[字节跳动小程序开发者工具](https://microapp.bytedance.com/docs/devtool/versionUpdate.html),然后在项目编译完后选择项目根目录下 `dist` 目录进行预览。 + +字节跳动小程序编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:tt +$ yarn build:tt +# npm script +$ npm run dev:tt +$ npm run build:tt +# 仅限全局安装 +$ taro build --type tt --watch +$ taro build --type tt +# npx 用户也可以使用 +$ npx taro build --type tt --watch +$ npx taro build --type tt +``` +### QQ 小程序 + +选择 QQ 小程序模式,需要自行下载并打开[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` 目录进行预览。 + +QQ 小程序编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:qq +$ yarn build:qq +# npm script +$ npm run dev:qq +$ npm run build:qq +# 仅限全局安装 +$ taro build --type qq --watch +$ taro build --type qq +# npx 用户也可以使用 +$ npx taro build --type qq --watch +$ npx taro build --type qq +``` +### 快应用 + +选择快应用模式,需要自行下载并打开[快应用开发者工具](https://www.quickapp.cn/docCenter/IDEPublicity),然后在项目编译完后,在开发者工具中选择「打开文件夹」选择项目根目录下 `dist` 目录,点击左边的预览图标(那个眼睛图标)进行预览。 + +快应用编译预览及打包(去掉 --watch 将不会监听文件修改,并会对代码进行压缩打包) + +```bash +# yarn +$ yarn dev:quickapp +$ yarn build:quickapp +# npm script +$ npm run dev:quickapp +$ npm run build:quickapp +# 仅限全局安装 +$ taro build --type quickapp --watch +$ taro build --type quickapp +# npx 用户也可以使用 +$ npx taro build --type quickapp --watch +$ npx taro build --type quickapp +``` +[快应用开发者工具如何使用?点击了解](https://doc.quickapp.cn/tutorial/ide/overview.html) + +[快应用端开发流程](https://taro-docs.jd.com/taro/docs/quick-app.html) + + +### H5 + +H5 模式,无需特定的开发者工具,在执行完下述命令之后即可通过浏览器进行预览 + +H5 预览项目 + +```bash +# yarn +$ yarn dev:h5 +# npm script +$ npm run dev:h5 +# 仅限全局安装 +$ taro build --type h5 --watch +# npx 用户也可以使用 +$ npx taro build --type h5 --watch +``` + +H5 打包项目 + +```bash +# yarn +$ yarn build:h5 +# npm script +$ npm run build:h5 +# 仅限全局安装 +$ taro build --type h5 +# npx 用户也可以使用 +$ npx taro build --type h5 +``` + +### React Native + +React Native 端运行需执行如下命令,React Native 端相关的运行说明请参见 [React Native 教程](https://nervjs.github.io/taro/docs/react-native.html) + +```bash +# yarn +$ yarn dev:rn +# npm script +$ npm run dev:rn +# 仅限全局安装 +$ taro build --type rn --watch +# npx 用户也可以使用 +$ npx taro build --type rn --watch +``` +> Note:React Native 端和其他端样式兼容性差异较大,如果需要兼容 React Native 端,建议 React Native 端和其他端同步开发。 + +> Note:如果要支持 React Native 端,必须采用 Flex 布局,并且样式选择器仅支持类选择器,且不 +支持 **组合器** [Combinators and groups of selectors](https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors)。 + +以下选择器的写法都是不支持的,在样式转换时会自动忽略。 + +```css +.button.button_theme_islands{ + font-style: bold; +} + +img + p { + font-style: bold; +} + +p ~ span { + color: red; +} + +div > span { + background-color: DodgerBlue; +} + +div span { background-color: DodgerBlue; } + +``` + +样式上 H5 最为灵活,小程序次之,RN 最弱,统一多端样式即是对齐短板,也就是要以 RN 的约束来管理样式,同时兼顾小程序的限制,核心可以用三点来概括: + +- 使用 Flex 布局 +- 基于 BEM 写样式 +- 采用 style 属性覆盖组件样式 + +RN 中 View 标签默认主轴方向是 column,如果不将其他端改成与 RN 一致,就需要在所有用到 display: flex 的地方都显式声明主轴方向。 + +## 更新 + +Taro 提供了更新命令来更新 CLI 工具自身和项目中 Taro 相关的依赖 + +更新 Taro CLI 工具 + +```bash +# taro +$ taro update self +# npm +npm i -g @tarojs/cli@latest +# yarn +yarn global add @tarojs/cli@latest +``` + +更新项目中 Taro 相关的依赖 + +```bash +$ taro update project +``` + +## 环境及依赖检测 +Taro 提供了命令来一键检测 Taro 环境及依赖的版本等信息,方便大家查看项目的环境及依赖,排查环境问题。在提 issue 的时候,请附上 `taro info` 打印的信息,帮助开发人员快速定位问题。 + +```bash +$ taro info +👽 Taro v1.2.0-beta.15 + + + Taro CLI 1.2.0-beta.15 environment info: + System: + OS: macOS High Sierra 10.13.5 + Shell: 5.3 - /bin/zsh + Binaries: + Node: 8.11.2 - /usr/local/bin/node + Yarn: 1.8.0 - /usr/local/bin/yarn + npm: 5.6.0 - /usr/local/bin/npm + npmPackages: + @tarojs/components: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/plugin-babel: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/plugin-csso: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/plugin-sass: ^1.2.0-beta.4 => 1.2.0-beta.4 + @tarojs/plugin-uglifyjs: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/rn-runner: ^1.2.0-beta.4 => 1.2.0-beta.4 + @tarojs/router: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/taro: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/taro-alipay: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/taro-h5: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/taro-swan: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/taro-weapp: ^1.2.0-beta.3 => 1.2.0-beta.3 + @tarojs/webpack-runner: ^1.2.0-beta.3 => 1.2.0-beta.3 + eslint-config-taro: ^1.2.0-beta.3 => 1.2.0-beta.3 + eslint-plugin-taro: ^1.2.0-beta.3 => 1.2.0-beta.3 +``` + +## Taro Doctor + +Taro Doctor 就像一个医生一样,可以诊断项目的依赖、设置、结构,以及代码的规范是否存在问题,并尝试给出解决方案。 + +但和真正的医生不一样,Taro Doctor 不需要排队挂号,也不用花钱。你只需要在终端运行命令:`taro doctor`,就像图里一样: + + + +## CLI 配置 + +> 自 `1.3.9` 开始支持 + +`1.3.9` 开始 Taro 会在用户根目录下创建 .taro 文件夹,其中 .taro/index.json 用于存放 CLI 相关配置。 + +开发者可以使用 `taro config` 命令对配置项进行一系列操作: + +```bash +# 查看用法 +$ taro config --help +# 设置配置项<key>的值为<value> +$ taro config set <key> <value> +# 读取配置项<key> +$ taro config get <key> +# 删除配置项<key> +$ taro config delete <key> +# 打印所有配置项 +$ taro config list [--json] +``` diff --git a/website/versioned_docs/version-1.3.15/components/open/ad.md b/website/versioned_docs/version-1.3.15/components/open/ad.md new file mode 100644 index 000000000000..41a4e24053e3 --- /dev/null +++ b/website/versioned_docs/version-1.3.15/components/open/ad.md @@ -0,0 +1,39 @@ +--- +title: Ad +sidebar_label: Ad +id: version-1.3.15-ad +original_id: ad +--- + +##### Banner 广告 + +> 组件 支持度 + +| 微信小程序 | +| :-: | +| ✔ | + + +>具体用法请看小程序官方文档 + +[微信小程序 Ad](https://developers.weixin.qq.com/miniprogram/dev/component/ad.html)。 + +```jsx +import Taro, { Component } from '@tarojs/taro' +// 引入 Ad 组件 +import { Ad } from '@tarojs/components' + +class App extends Component { + render () { + return ( + <Ad + unit-id='' + ad-intervals={60} + onLoad={() => console.log('ad onLoad')} + onError={() => console.log('ad onError')} + onClose={() => console.log('ad onClose')} + /> + ) + } +} +``` diff --git a/website/versioned_docs/version-1.3.15/components/open/official-account.md b/website/versioned_docs/version-1.3.15/components/open/official-account.md new file mode 100644 index 000000000000..9e94c18dd4e3 --- /dev/null +++ b/website/versioned_docs/version-1.3.15/components/open/official-account.md @@ -0,0 +1,36 @@ +--- +title: OfficialAccount +sidebar_label: OfficialAccount +id: version-1.3.15-official-account +original_id: official-account +--- + +##### 公众号关注组件。当用户扫小程序码打开小程序时,开发者可在小程序内配置公众号关注组件,方便用户快捷关注公众号,可嵌套在原生组件内。 + +> 组件 支持度 + +| 微信小程序 | +| :-: | +| ✔ | + + +>具体用法请看小程序官方文档 + +[微信小程序 OfficialAccount](https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html)。 + +```jsx +import Taro, { Component } from '@tarojs/taro' +// 引入 OfficialAccount 组件 +import { OfficialAccount } from '@tarojs/components' + +class App extends Component { + render () { + return ( + <OfficialAccount + onLoad={() => console.log('official-account onLoad')} + onError={() => console.log('official-account onError')} + /> + ) + } +} +``` diff --git a/website/versioned_docs/version-1.3.15/components/open/open-data.md b/website/versioned_docs/version-1.3.15/components/open/open-data.md new file mode 100644 index 000000000000..4c18f4e365c0 --- /dev/null +++ b/website/versioned_docs/version-1.3.15/components/open/open-data.md @@ -0,0 +1,35 @@ +--- +title: OpenData +sidebar_label: OpenData +id: version-1.3.15-open-data +original_id: open-data +--- + +##### 用于展示小程序开放的数据。 + +> 组件 支持度 + +| 微信小程序 | 百度小程序 | +| :-: | :-: | +| ✔ | ✔ | + + +>具体用法请看小程序官方文档 + +[微信小程序 OpenData](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html)。 + +[百度小程序 OpenData](https://smartprogram.baidu.com/docs/develop/component/open/#open-data/)。 + +```jsx +import Taro, { Component } from '@tarojs/taro' +// 引入 Ad 组件 +import { OpenData } from '@tarojs/components' + +class App extends Component { + render () { + return ( + <OpenData type=''/> + ) + } +} +``` diff --git a/website/versioned_docs/version-1.3.15/components/open/others.md b/website/versioned_docs/version-1.3.15/components/open/others.md new file mode 100644 index 000000000000..24238dcfad81 --- /dev/null +++ b/website/versioned_docs/version-1.3.15/components/open/others.md @@ -0,0 +1,21 @@ +--- +title: 其他 +sidebar_label: 其他 +id: version-1.3.15-others +original_id: others +--- + +##### 其他组件 + +除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。 + +>其他组件请看各小程序官方文档 + +[微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)。 + +[百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)。 + +[支付宝小程序](https://docs.alipay.com/mini/component/overview)。 + +[字节跳动小程序](https://developer.toutiao.com/docs/comp/)。 + diff --git a/website/versioned_docs/version-1.3.15/size.md b/website/versioned_docs/version-1.3.15/size.md new file mode 100644 index 000000000000..7c3ea0435ca4 --- /dev/null +++ b/website/versioned_docs/version-1.3.15/size.md @@ -0,0 +1,169 @@ +--- +title: 设计稿及尺寸单位 +id: version-1.3.15-size +original_id: size +--- + +在 Taro 中尺寸单位建议使用 `px`、 `百分比 %`,Taro 默认会对所有单位进行转换。在 Taro 中书写尺寸按照 1:1 的关系来进行书写,即从设计稿上量的长度 `100px`,那么尺寸书写就是 `100px`,当转成微信小程序的时候,尺寸将默认转换为 `100rpx`,当转成 H5 时将默认转换为以 `rem` 为单位的值。 + +如果你希望部分 `px` 单位不被转换成 `rpx` 或者 `rem` ,最简单的做法就是在 px 单位中增加一个大写字母,例如 `Px` 或者 `PX` 这样,则会被转换插件忽略。 + +结合过往的开发经验,Taro 默认以 `750px` 作为换算尺寸标准,如果设计稿不是以 `750px` 为标准,则需要在项目配置 `config/index.js` 中进行设置,例如设计稿尺寸是 `640px`,则需要修改项目配置 `config/index.js` 中的 `designWidth` 配置为 `640`: + +```jsx +const config = { + projectName: 'myProject', + date: '2018-4-18', + designWidth: 640, + .... +} +``` + +目前 Taro 支持 `750`、 `640` 、 `828` 三种尺寸设计稿,他们的换算规则如下: + +```jsx +const DEVICE_RATIO = { + '640': 2.34 / 2, + '750': 1, + '828': 1.81 / 2 +} +``` + +建议使用 Taro 时,设计稿以 iPhone 6 `750px` 作为设计尺寸标准。 + +如果你的设计稿是 `375` ,不在以上三种之中,那么你需要把 `designWidth` 配置为 `375`,同时在 `DEVICE_RATIO` 中添加换算规则如下: +```jsx +const DEVICE_RATIO = { + '640': 2.34 / 2, + '750': 1, + '828': 1.81 / 2, + '375': 2 / 1 +} +``` + +## API + +在编译时,Taro 会帮你对样式做尺寸转换操作,但是如果是在 JS 中书写了行内样式,那么编译时就无法做替换了,针对这种情况,Taro 提供了 API `Taro.pxTransform` 来做运行时的尺寸转换。 + +```jsx +Taro.pxTransform(10) // 小程序:rpx,H5:rem +``` + +## 配置 + +默认配置会对所有的 `px` 单位进行转换,有大写字母的 `Px` 或 `PX` 则会被忽略。 + +参数默认值如下: + +```js +{ + onePxTransform: true, + unitPrecision: 5, + propList: ['*'], + selectorBlackList: [], + replace: true, + mediaQuery: false, + minPixelValue: 0 +} +``` + +Type: `Object | Null` + +### `onePxTransform` (Boolean) + +设置 1px 是否需要被转换 + +### `unitPrecision` (Number) + +REM 单位允许的小数位。 + +### `propList` (Array) + +允许转换的属性。 + +- Values need to be exact matches. +- Use wildcard `*` to enable all properties. Example: `['*']` +- Use `*` at the start or end of a word. (`['*position*']` will match `background-position-y`) +- Use `!` to not match a property. Example: `['*', '!letter-spacing']` +- Combine the "not" prefix with the other prefixes. Example: `['*', '!font*']` + +### `selectorBlackList` + +黑名单里的选择器将会被忽略。 + +- If value is string, it checks to see if selector contains the string. + - `['body']` will match `.body-class` +- If value is regexp, it checks to see if the selector matches the regexp. + - `[/^body$/]` will match `body` but not `.body` + +### `replace` (Boolean) + +直接替换而不是追加一条进行覆盖。 + +### `mediaQuery` (Boolean) + +允许媒体查询里的 px 单位转换 + +### `minPixelValue` (Number) + +设置一个可被转换的最小 px 值 + +配置规则对应到 `config/index.js` ,例如: + +```js +{ + h5: { + publicPath: '/', + staticDirectory: 'static', + module: { + postcss: { + autoprefixer: { + enable: true + }, + pxtransform: { + enable: true, + config: { + selectorBlackList: ['body'] + } + } + } + } + }, + weapp: { + // ... + module: { + postcss: { + pxtransform: { + enable: true, + config: { + selectorBlackList: ['body'] + } + } + } + } + } +} +``` + +## 忽略 + +### 属性 + +当前忽略单个属性的最简单的方法,就是 px 单位使用大写字母。 + +```css + /* `px` is converted to `rem` */ +.convert { + font-size: 16px; // converted to 1rem +} + + /* `Px` or `PX` is ignored by `postcss-pxtorem` but still accepted by browsers */ +.ignore { + border: 1Px solid; // ignored + border-width: 2PX; // ignored +} +``` + +### 文件 + +对于头部包含注释 `/*postcss-pxtransform disable*/` 的文件,插件不予处理。 diff --git a/website/versioned_sidebars/version-1.3.15-sidebars.json b/website/versioned_sidebars/version-1.3.15-sidebars.json new file mode 100644 index 000000000000..7748a23f2769 --- /dev/null +++ b/website/versioned_sidebars/version-1.3.15-sidebars.json @@ -0,0 +1,632 @@ +{ + "version-1.3.15-docs": { + "关于Taro": [ + "version-1.3.15-README", + "version-1.3.15-taroize", + "version-1.3.15-team" + ], + "快速开始": [ + "version-1.3.15-GETTING-STARTED", + "version-1.3.15-composition", + "version-1.3.15-before-dev-remind", + "version-1.3.15-specials" + ], + "基础教程": [ + "version-1.3.15-spec-for-taro", + "version-1.3.15-tutorial", + "version-1.3.15-project-config", + "version-1.3.15-router", + "version-1.3.15-size", + "version-1.3.15-static-reference", + "version-1.3.15-component-style", + { + "label": "语法特性", + "type": "subcategory", + "ids": [ + "version-1.3.15-jsx", + "version-1.3.15-props", + "version-1.3.15-state", + "version-1.3.15-event", + "version-1.3.15-condition", + "version-1.3.15-list", + "version-1.3.15-functional-component", + "version-1.3.15-context", + "version-1.3.15-children", + "version-1.3.15-render-props", + "version-1.3.15-ref" + ] + }, + "version-1.3.15-best-practice", + "version-1.3.15-debug", + { + "label": "多端开发", + "type": "subcategory", + "ids": [ + "version-1.3.15-envs", + "version-1.3.15-relations", + "version-1.3.15-wxcloud", + "version-1.3.15-miniprogram-plugin", + "version-1.3.15-quick-app", + "version-1.3.15-react-native" + ] + } + ], + "进阶指南": [ + "version-1.3.15-config", + "version-1.3.15-config-detail", + "version-1.3.15-hooks", + "version-1.3.15-ui-lib", + "version-1.3.15-async-await", + "version-1.3.15-mini-third-party", + "version-1.3.15-hybrid", + "version-1.3.15-optimized-practice" + ], + "社区生态": [ + "version-1.3.15-redux", + "version-1.3.15-mobx", + "version-1.3.15-css-modules", + "version-1.3.15-template", + "version-1.3.15-CONTRIBUTING" + ] + }, + "version-1.3.15-components": { + "关于组件库": [ + "version-1.3.15-components-desc" + ], + "视图容器": [ + "version-1.3.15-components/viewContainer/view", + "version-1.3.15-components/viewContainer/scroll-view", + "version-1.3.15-components/viewContainer/swiper", + "version-1.3.15-components/viewContainer/movable-view", + "version-1.3.15-components/viewContainer/cover-view" + ], + "基础内容": [ + "version-1.3.15-components/base/icon", + "version-1.3.15-components/base/text", + "version-1.3.15-components/base/progress", + "version-1.3.15-components/base/rich-text" + ], + "表单组件": [ + "version-1.3.15-components/forms/button", + "version-1.3.15-components/forms/checkbox", + "version-1.3.15-components/forms/form", + "version-1.3.15-components/forms/input", + "version-1.3.15-components/forms/label", + "version-1.3.15-components/forms/picker", + "version-1.3.15-components/forms/picker-view", + "version-1.3.15-components/forms/radio", + "version-1.3.15-components/forms/slider", + "version-1.3.15-components/forms/switch", + "version-1.3.15-components/forms/textarea" + ], + "导航": [ + "version-1.3.15-components/navig/navigator" + ], + "媒体组件": [ + "version-1.3.15-components/media/audio", + "version-1.3.15-components/media/image", + "version-1.3.15-components/media/video", + "version-1.3.15-components/media/camera" + ], + "地图": [ + "version-1.3.15-components/maps/map" + ], + "画布": [ + "version-1.3.15-components/canvas/canvas" + ], + "开放能力": [ + "version-1.3.15-components/open/ad", + "version-1.3.15-components/open/official-account", + "version-1.3.15-components/open/open-data", + "version-1.3.15-components/open/web-view", + "version-1.3.15-components/open/others" + ] + }, + "version-1.3.15-API": { + "关于API": [ + "version-1.3.15-apis/about/desc", + "version-1.3.15-apis/about/tarocomponent", + "version-1.3.15-apis/about/env", + "version-1.3.15-apis/about/events" + ], + "设备": [ + { + "label": "加速度计", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/accelerometer/startAccelerometer", + "version-1.3.15-apis/device/accelerometer/stopAccelerometer", + "version-1.3.15-apis/device/accelerometer/onAccelerometerChange" + ] + }, + { + "label": "设备方向", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/deviceMotion/startDeviceMotionListening", + "version-1.3.15-apis/device/deviceMotion/stopDeviceMotionListening", + "version-1.3.15-apis/device/deviceMotion/onDeviceMotionChange" + ] + }, + { + "label": "蓝牙", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/bluetooth/closeBluetoothAdapter", + "version-1.3.15-apis/device/bluetooth/getBluetoothAdapterState", + "version-1.3.15-apis/device/bluetooth/getBluetoothDevices", + "version-1.3.15-apis/device/bluetooth/getConnectedBluetoothDevices", + "version-1.3.15-apis/device/bluetooth/onBluetoothAdapterStateChange", + "version-1.3.15-apis/device/bluetooth/onBluetoothDeviceFound", + "version-1.3.15-apis/device/bluetooth/openBluetoothAdapter", + "version-1.3.15-apis/device/bluetooth/startBluetoothDevicesDiscovery", + "version-1.3.15-apis/device/bluetooth/stopBluetoothDevicesDiscovery" + ] + }, + { + "label": "低功耗蓝牙", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/ble/closeBLEConnection", + "version-1.3.15-apis/device/ble/createBLEConnection", + "version-1.3.15-apis/device/ble/getBLEDeviceCharacteristics", + "version-1.3.15-apis/device/ble/getBLEDeviceServices", + "version-1.3.15-apis/device/ble/notifyBLECharacteristicValueChange", + "version-1.3.15-apis/device/ble/onBLECharacteristicValueChange", + "version-1.3.15-apis/device/ble/onBLEConnectionStateChange", + "version-1.3.15-apis/device/ble/readBLECharacteristicValue", + "version-1.3.15-apis/device/ble/writeBLECharacteristicValue" + ] + }, + { + "label": "亮度", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/brightness/getScreenBrightness", + "version-1.3.15-apis/device/brightness/setKeepScreenOn", + "version-1.3.15-apis/device/brightness/setScreenBrightness" + ] + }, + { + "label": "剪贴板", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/clipboard/getClipboardData", + "version-1.3.15-apis/device/clipboard/setClipboardData" + ] + }, + { + "label": "罗盘", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/compass/onCompassChange", + "version-1.3.15-apis/device/compass/startCompass", + "version-1.3.15-apis/device/compass/stopCompass" + ] + }, + { + "label": "联系人", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/contacts/addPhoneContact" + ] + }, + { + "label": "iBeacon", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/ibeacon/getBeacons", + "version-1.3.15-apis/device/ibeacon/onBeaconServiceChange", + "version-1.3.15-apis/device/ibeacon/onBeaconUpdate", + "version-1.3.15-apis/device/ibeacon/startBeaconDiscovery", + "version-1.3.15-apis/device/ibeacon/stopBeaconDiscovery" + ] + }, + { + "label": "网络", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/netstat/getNetworkType", + "version-1.3.15-apis/device/netstat/onNetworkStatusChange" + ] + }, + { + "label": "NFC", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/nfc/getHCEState", + "version-1.3.15-apis/device/nfc/onHCEMessage", + "version-1.3.15-apis/device/nfc/sendHCEMessage", + "version-1.3.15-apis/device/nfc/startHCE", + "version-1.3.15-apis/device/nfc/stopHCE" + ] + }, + { + "label": "电话", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/phone/makePhoneCall" + ] + }, + { + "label": "扫码", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/scancode/scancode" + ] + }, + { + "label": "屏幕", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/screenshot/onUserCaptureScreen" + ] + }, + { + "label": "振动", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/vibrate/vibrateLong", + "version-1.3.15-apis/device/vibrate/vibrateShort" + ] + }, + { + "label": "系统信息", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/systeminfo/canIUse", + "version-1.3.15-apis/device/systeminfo/getSystemInfo", + "version-1.3.15-apis/device/systeminfo/getSystemInfoSync" + ] + }, + { + "label": "Wi-Fi", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/device/wifi/connectWifi", + "version-1.3.15-apis/device/wifi/getConnectedWifi", + "version-1.3.15-apis/device/wifi/getWifiList", + "version-1.3.15-apis/device/wifi/onGetWifiList", + "version-1.3.15-apis/device/wifi/onWifiConnected", + "version-1.3.15-apis/device/wifi/setWifiList", + "version-1.3.15-apis/device/wifi/startWifi", + "version-1.3.15-apis/device/wifi/stopWifi" + ] + } + ], + "扩展API": [ + "version-1.3.15-apis/extend-apis/arrayBufferToBase64", + "version-1.3.15-apis/extend-apis/base64ToArrayBuffer" + ], + "文件": [ + "version-1.3.15-apis/files/getFileInfo", + "version-1.3.15-apis/files/getSavedFileInfo", + "version-1.3.15-apis/files/getSavedFileList", + "version-1.3.15-apis/files/openDocument", + "version-1.3.15-apis/files/removeSavedFile", + "version-1.3.15-apis/files/saveFile" + ], + "界面": [ + { + "label": "动画", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/animation/createAnimation" + ] + }, + { + "label": "画布", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/canvas/createCanvasContext", + "version-1.3.15-apis/interface/canvas/canvasGetImageData", + "version-1.3.15-apis/interface/canvas/canvasPutImageData", + "version-1.3.15-apis/interface/canvas/canvasToTempFilePath", + "version-1.3.15-apis/interface/canvas/createContext", + "version-1.3.15-apis/interface/canvas/drawCanvas" + ] + }, + { + "label": "交互", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/interactives/showToast", + "version-1.3.15-apis/interface/interactives/showLoading", + "version-1.3.15-apis/interface/interactives/hideToast", + "version-1.3.15-apis/interface/interactives/hideLoading", + "version-1.3.15-apis/interface/interactives/showModal", + "version-1.3.15-apis/interface/interactives/showActionSheet" + ] + }, + { + "label": "导航", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/navigation/navigateTo", + "version-1.3.15-apis/interface/navigation/redirectTo", + "version-1.3.15-apis/interface/navigation/switchTab", + "version-1.3.15-apis/interface/navigation/navigateBack", + "version-1.3.15-apis/interface/navigation/reLaunch", + "version-1.3.15-apis/interface/navigation/getCurrentPages" + ] + }, + { + "label": "导航栏", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/navigationbar/setNavigationBarTitle", + "version-1.3.15-apis/interface/navigationbar/showNavigationBarLoading", + "version-1.3.15-apis/interface/navigationbar/hideNavigationBarLoading", + "version-1.3.15-apis/interface/navigationbar/setNavigationBarColor" + ] + }, + { + "label": "滚动", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/pagescroll/pageScrollTo" + ] + }, + { + "label": "下拉刷新", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/pulldownrefresh/startPullDownRefresh", + "version-1.3.15-apis/interface/pulldownrefresh/stopPullDownRefresh" + ] + }, + { + "label": "tabbar", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/tabbar/setTabBarBadge", + "version-1.3.15-apis/interface/tabbar/removeTabBarBadge", + "version-1.3.15-apis/interface/tabbar/showTabBarRedDot", + "version-1.3.15-apis/interface/tabbar/hideTabBarRedDot", + "version-1.3.15-apis/interface/tabbar/setTabBarStyle", + "version-1.3.15-apis/interface/tabbar/setTabBarItem", + "version-1.3.15-apis/interface/tabbar/showTabBar", + "version-1.3.15-apis/interface/tabbar/hideTabBar" + ] + }, + { + "label": "顶栏", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/topbar/setTopBarText" + ] + }, + { + "label": "窗口", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/window/onWindowResize", + "version-1.3.15-apis/interface/window/offWindowResize" + ] + }, + { + "label": "wxml", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/interface/wxml/createSelectorQuery", + "version-1.3.15-apis/interface/wxml/selectorQuery_in", + "version-1.3.15-apis/interface/wxml/selectorQuery_select", + "version-1.3.15-apis/interface/wxml/selectorQuery_selectAll", + "version-1.3.15-apis/interface/wxml/selectorQuery_selectViewport", + "version-1.3.15-apis/interface/wxml/nodesRef_boundingClientRect", + "version-1.3.15-apis/interface/wxml/nodesRef_scrollOffset", + "version-1.3.15-apis/interface/wxml/nodesRef_fields", + "version-1.3.15-apis/interface/wxml/selectorQuery_exec" + ] + } + ], + "位置": [ + "version-1.3.15-apis/location/getLocation", + "version-1.3.15-apis/location/openLocation", + "version-1.3.15-apis/location/chooseLocation" + ], + "媒体": [ + { + "label": "音频", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/audio/playVoice", + "version-1.3.15-apis/multimedia/audio/pauseVoice", + "version-1.3.15-apis/multimedia/audio/stopVoice", + "version-1.3.15-apis/multimedia/audio/createAudioContext", + "version-1.3.15-apis/multimedia/audio/createInnerAudioContext" + ] + }, + { + "label": "背景音频", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/backgroundaudio/getBackgroundAudioManager", + "version-1.3.15-apis/multimedia/backgroundaudio/getBackgroundAudioPlayerState", + "version-1.3.15-apis/multimedia/backgroundaudio/playBackgroundAudio", + "version-1.3.15-apis/multimedia/backgroundaudio/pauseBackgroundAudio", + "version-1.3.15-apis/multimedia/backgroundaudio/seekBackgroundAudio", + "version-1.3.15-apis/multimedia/backgroundaudio/stopBackgroundAudio", + "version-1.3.15-apis/multimedia/backgroundaudio/onBackgroundAudioPlay", + "version-1.3.15-apis/multimedia/backgroundaudio/onBackgroundAudioPause", + "version-1.3.15-apis/multimedia/backgroundaudio/onBackgroundAudioStop" + ] + }, + { + "label": "相机", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/camera/createCameraContext" + ] + }, + { + "label": "图片", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/images/chooseImage", + "version-1.3.15-apis/multimedia/images/previewImage", + "version-1.3.15-apis/multimedia/images/getImageInfo", + "version-1.3.15-apis/multimedia/images/saveImageToPhotosAlbum" + ] + }, + { + "label": "地图", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/map/createMapContext" + ] + }, + { + "label": "录音", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/recording/startRecord", + "version-1.3.15-apis/multimedia/recording/stopRecord" + ] + }, + { + "label": "视频", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/multimedia/video/chooseVideo", + "version-1.3.15-apis/multimedia/video/saveVideoToPhotosAlbum", + "version-1.3.15-apis/multimedia/video/createVideoContext" + ] + } + ], + "网络": [ + { + "label": "文件上传/下载", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/network/fileTransfer/uploadFile", + "version-1.3.15-apis/network/fileTransfer/downloadFile" + ] + }, + { + "label": "请求", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/network/request/request", + "version-1.3.15-apis/network/request/addInterceptor" + ] + }, + { + "label": "WebSocket", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/network/socket/connectSocket", + "version-1.3.15-apis/network/socket/sendSocketMessage", + "version-1.3.15-apis/network/socket/closeSocket", + "version-1.3.15-apis/network/socket/onSocketOpen", + "version-1.3.15-apis/network/socket/onSocketMessage", + "version-1.3.15-apis/network/socket/onSocketClose", + "version-1.3.15-apis/network/socket/onSocketError", + "version-1.3.15-apis/network/socket/SocketTask" + ] + } + ], + "开放接口": [ + { + "label": "地址", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/address/chooseAddress" + ] + }, + { + "label": "认证", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/auth/authorize" + ] + }, + { + "label": "生物认证", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/bioauth/checkIsSoterEnrolledInDevice", + "version-1.3.15-apis/open-api/bioauth/checkIsSupportSoterAuthentication", + "version-1.3.15-apis/open-api/bioauth/startSoterAuthentication" + ] + }, + { + "label": "卡券", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/card/addCard", + "version-1.3.15-apis/open-api/card/openCard" + ] + }, + { + "label": "发票", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/invoice/chooseInvoice", + "version-1.3.15-apis/open-api/invoice/chooseInvoiceTitle" + ] + }, + { + "label": "登录", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/login/login", + "version-1.3.15-apis/open-api/login/checkSession" + ] + }, + { + "label": "支付", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/payment/faceVerifyForPay", + "version-1.3.15-apis/open-api/payment/requestPayment" + ] + }, + { + "label": "跳转小程序", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/redirect/navigateBackMiniProgram", + "version-1.3.15-apis/open-api/redirect/navigateToMiniProgram" + ] + }, + { + "label": "设置", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/settings/getSetting", + "version-1.3.15-apis/open-api/settings/openSetting" + ] + }, + { + "label": "用户信息", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/userinfo/getUserInfo" + ] + }, + { + "label": "微信运动", + "type": "subcategory", + "ids": [ + "version-1.3.15-apis/open-api/werun/getWeRunData" + ] + } + ], + "数据缓存": [ + "version-1.3.15-apis/storage/setStorage", + "version-1.3.15-apis/storage/setStorageSync", + "version-1.3.15-apis/storage/getStorage", + "version-1.3.15-apis/storage/getStorageSync", + "version-1.3.15-apis/storage/getStorageInfo", + "version-1.3.15-apis/storage/getStorageInfoSync", + "version-1.3.15-apis/storage/removeStorage", + "version-1.3.15-apis/storage/removeStorageSync", + "version-1.3.15-apis/storage/clearStorage", + "version-1.3.15-apis/storage/clearStorageSync" + ], + "更新": [ + "version-1.3.15-apis/updates/getUpdateManager" + ] + } +} diff --git a/website/versions.json b/website/versions.json index 2ed0206a61a6..1b00cf836b8b 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,3 +1,4 @@ [ + "1.3.15", "1.3.14" ]