From 5e8c5a7b6ce2ffd1ea1057823346f41f4447e358 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 10 Nov 2017 21:53:03 -0600 Subject: [PATCH] [Doc] add toast english document (#307) * fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment --- docs/examples-docs/en-US/area.md | 2 + docs/examples-docs/en-US/toast.md | 70 +++++++++++++++---------------- docs/examples-docs/zh-CN/area.md | 2 + package.json | 2 +- yarn.lock | 6 +-- 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/docs/examples-docs/en-US/area.md b/docs/examples-docs/en-US/area.md index 012d9e371..0e80231b6 100644 --- a/docs/examples-docs/en-US/area.md +++ b/docs/examples-docs/en-US/area.md @@ -115,6 +115,8 @@ export default { } ``` +完整数据见 [Area.json](https://github.com/youzan/vant/blob/dev/docs/mock/area.json) + #### 点击完成时返回的Data Structure 返回的数据整体为一个数组,数组内包含 `columnsNum` 个数据, 每个数据对应一列选项中被选中的数据。 diff --git a/docs/examples-docs/en-US/toast.md b/docs/examples-docs/en-US/toast.md index 5d36b3d45..ad04c3db1 100644 --- a/docs/examples-docs/en-US/toast.md +++ b/docs/examples-docs/en-US/toast.md @@ -4,29 +4,29 @@ import { Toast } from 'packages'; export default { methods: { showToast() { - Toast('我是提示文案,建议不超过十五字~'); + Toast('Some messages'); }, showLoadingToast() { Toast.loading({ mask: true }); }, showSuccessToast() { - Toast.success('成功文案'); + Toast.success('Success'); }, showFailToast() { - Toast.fail('失败文案'); + Toast.fail('Fail'); }, showCustomizedToast(duration) { const toast = Toast.loading({ duration: 0, forbidClick: true, - message: '倒计时 3 秒' + message: '3 seconds' }); let second = 3; const timer = setInterval(() => { second--; if (second) { - toast.message = `倒计时 ${second} 秒`; + toast.message = `${second} seconds`; } else { clearInterval(timer); Toast.clear(); @@ -47,29 +47,29 @@ import { Toast } from 'vant'; ### Usage -#### 文字提示 +#### Text -:::demo 文字提示 +:::demo Text ```html -文字提示 +Show Text ``` ```javascript export default { methods: { showToast() { - Toast('我是提示文案,建议不超过十五字~'); + Toast('Some messages'); } } } ``` ::: -#### 加载提示 +#### Loading -:::demo 加载提示 +:::demo Loading ```html -加载提示 +Show Loading ``` ```javascript @@ -83,22 +83,22 @@ export default { ``` ::: -#### 成功/失败提示 +#### Success/Fail -:::demo 成功/失败提示 +:::demo Success/Fail ```html -成功提示 -失败提示 +Show Success +Show Fail ``` ```javascript export default { methods: { showSuccessToast() { - Toast.success('成功文案'); + Toast.success('Success'); }, showFailToast() { - Toast.fail('失败文案'); + Toast.fail('Fail'); } } } @@ -117,16 +117,16 @@ export default { methods: { showCustomizedToast() { const toast = Toast.loading({ - duration: 0, // 持续展示 toast - forbidClick: true, // 禁用背景点击 - message: '倒计时 3 秒' + duration: 0, // continuous display toast + forbidClick: true, // forbid click background + message: '3 seconds' }); let second = 3; const timer = setInterval(() => { second--; if (second) { - toast.message = `倒计时 ${second} 秒`; + toast.message = `${second} seconds`; } else { clearInterval(timer); Toast.clear(); @@ -138,23 +138,23 @@ export default { ``` ::: -### 方法 +### Methods -| 方法名 | Attribute | 返回值 | 介绍 | +| Methods | Attribute | Return value | Description | |-----------|-----------|-----------|-------------| -| Toast | `options | message` | toast 实例 | 展示提示 | -| Toast.loading | `options | message` | toast 实例 | 展示加载提示 | -| Toast.success | `options | message` | toast 实例 | 展示成功提示 | -| Toast.fail | `options | message` | toast 实例 | 展示失败提示 | -| Toast.clear | - | `void` | 关闭提示 | +| Toast | `options | message` | toast instance | Show toast | +| Toast.loading | `options | message` | toast instance | Show loading toast | +| Toast.success | `options | message` | toast instance | Show success toast | +| Toast.fail | `options | message` | toast instance | Show fail toast | +| Toast.clear | - | `void` | Close | ### Options | Attribute | Description | Type | Default | Accepted Values | |-----------|-----------|-----------|-------------|-------------| -| type | 提示类型 | `String` | `text` | `loading` `success` `fail` `html` | -| message | 内容 | `String` | `''` | - | -| position | 位置 | `String` | `middle` | `top` `bottom` | -| mask | 是否显示背景蒙层 | `Boolean` | `false` | - | -| forbidClick | 禁止背景点击 | `Boolean` | `false` | - | -| duration | 时长(ms) | `Number` | `3000` | 值为 0 时,toast 不会消失 | +| type | Type | `String` | `text` | `loading` `success` `fail` `html` | +| message | Message | `String` | `''` | - | +| position | Position | `String` | `middle` | `top` `bottom` | +| mask | Whether to show mask | `Boolean` | `false` | - | +| forbidClick | Whether to forbid click background | `Boolean` | `false` | - | +| duration | Toast duration(ms) | `Number` | `3000` | Toast won't disappear if value is 0 | diff --git a/docs/examples-docs/zh-CN/area.md b/docs/examples-docs/zh-CN/area.md index 5dd5198c2..27c37826b 100644 --- a/docs/examples-docs/zh-CN/area.md +++ b/docs/examples-docs/zh-CN/area.md @@ -115,6 +115,8 @@ export default { } ``` +完整数据见 [Area.json](https://github.com/youzan/vant/blob/dev/docs/mock/area.json) + #### 点击完成时返回的数据格式 返回的数据整体为一个数组,数组内包含 `columnsNum` 个数据, 每个数据对应一列选项中被选中的数据。 diff --git a/package.json b/package.json index 889f03d3a..b83985170 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,6 @@ "webpack-bundle-analyzer": "^2.9.0", "webpack-dev-server": "^2.9.4", "webpack-merge": "^4.1.1", - "zan-doc": "0.3.10" + "zan-doc": "0.3.11" } } diff --git a/yarn.lock b/yarn.lock index 019c15c92..3e8e3c181 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8217,9 +8217,9 @@ yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" -zan-doc@0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/zan-doc/-/zan-doc-0.3.10.tgz#c3130c81cbb66e0feceb6d5a84d89b39db69659a" +zan-doc@0.3.11: + version "0.3.11" + resolved "https://registry.yarnpkg.com/zan-doc/-/zan-doc-0.3.11.tgz#5a74a409b98a97536a93fb04ca9d634aea182e4d" dependencies: cheerio "0.22.0" decamelize "^1.2.0"