From 5c8fcf89efe127874c91c14e95cf4b3069c2d069 Mon Sep 17 00:00:00 2001 From: Yugang Cao <34439652+Talljack@users.noreply.github.com> Date: Tue, 27 Jul 2021 16:50:59 +0800 Subject: [PATCH 1/5] docs: add input-number docs (#681) Co-authored-by: yugang.cao --- src/input-number/demos/enUS/index.demo-entry.md | 2 +- src/input-number/demos/zhCN/index.demo-entry.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input-number/demos/enUS/index.demo-entry.md b/src/input-number/demos/enUS/index.demo-entry.md index 74b4f9890..c264664fc 100644 --- a/src/input-number/demos/enUS/index.demo-entry.md +++ b/src/input-number/demos/enUS/index.demo-entry.md @@ -24,7 +24,7 @@ show-button | disabled | `boolean` | `false` | Whether to disable the input. | | max | `number` | `undefined` | The max value. | | min | `number` | `undefined` | The min value. | -| placeholder | `string` | `'Please Input'` | | +| placeholder | `string` | `'Please Input'` | Placeholder of input number. | | show-button | `boolean` | `true` | Whether to show buttons. | | size | `'small' \| 'medium' \| 'large'` | `'medium'` | The size of input box. | | step | `number` | `1` | The number to which the current value is increased or decreased. It can be an integer or decimal. | diff --git a/src/input-number/demos/zhCN/index.demo-entry.md b/src/input-number/demos/zhCN/index.demo-entry.md index ec0ad1645..d6dea212a 100644 --- a/src/input-number/demos/zhCN/index.demo-entry.md +++ b/src/input-number/demos/zhCN/index.demo-entry.md @@ -25,7 +25,7 @@ debug | disabled | `boolean` | `false` | 是否禁用 | | max | `number` | `undefined` | 最大值 | | min | `number` | `undefined` | 最小值 | -| placeholder | `string` | `'请输入'` | | +| placeholder | `string` | `'请输入'` | 提示信息 | | show-button | `boolean` | `true` | 是否有按钮 | | size | `'small' \| 'medium' \| 'large'` | `'medium'` | 输入框大小 | | step | `number` | `1` | 每次改变步数,可以为小数 | From 9c53004277684eddf1863277bb0763eac1fde40b Mon Sep 17 00:00:00 2001 From: Yugang Cao <34439652+Talljack@users.noreply.github.com> Date: Tue, 27 Jul 2021 23:06:56 +0800 Subject: [PATCH 2/5] docs(select): api table (#682) Co-authored-by: yugang.cao --- src/select/demos/enUS/index.demo-entry.md | 18 +++++++++--------- src/select/demos/zhCN/index.demo-entry.md | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/select/demos/enUS/index.demo-entry.md b/src/select/demos/enUS/index.demo-entry.md index 1ea28dbfd..1947a69af 100644 --- a/src/select/demos/enUS/index.demo-entry.md +++ b/src/select/demos/enUS/index.demo-entry.md @@ -38,12 +38,12 @@ render-tag | disabled | `boolean` | `false` | Whether to disable the select. | | fallback-option | `false \| (value: string \| number) => SelectOption` | `value => ({ label: '' + value, value })` | The option to be created according the value which has no corresponding option in the options of the component. If set to `false`, the fallback option won't be created and displayed and the value has no corresponding option will be viewed as a invalid value and it will be removed in the operations of the component. | | filterable | `boolean` | `false` | Whether it can filter options. | -| filter | `(pattern: string, option: Object) => boolean` | A basic string based search method. | | +| filter | `(pattern: string, option: Object) => boolean` | A basic string based search method. | Filter function. | | loading | `boolean` | `false` | Whether to show loading status. | | max-tag-count | `number \| 'responsive'` | `undefined` | Max tag count in multiple mode. `responsive` will keep all the tags in single line. | | multiple | `boolean` | `false` | Whether to select multiple values. | | options | `Array` | `[]` | For details of configuration options, see SelectOption Properties. | -| placeholder | `string` | `'Please Select'` | | +| placeholder | `string` | `'Please Select'` | Placeholder of select. | | remote | `boolean` | `false` | If you want to async get options. Note that if remote is set, `filter` & `tag` won't work on `options`. At that time, you are taking all control of `options`. | | render-label | `(option: SelectOption \| SelectGroupOption, selected: boolean) => VNodeChild` | `undefined` | Render function of all the options' label. | | render-option | `(info: { node: VNode, option: SelectOption \| SelectGroupOption, selected: boolean } }` | `undefined` | Render function of all the options. | @@ -54,12 +54,12 @@ render-tag | tag | `boolean` | `false` | Whether it can create new option, should be used with `filterable`. | | value | `Array \| string \| number \| null` | `undefined` | Value in controlled mode. | | virtual-scroll | `boolean` | `true` | Whether to enable virtual scrolling. | -| on-blur | `() => void` | `undefined` | Selection blur. | +| on-blur | `() => void` | `undefined` | Callback triggered when selection blur. | | on-create | `(label: string) => SelectOption` | `label => ({ label, value: label })` | How to create a option when you input a string to create a option. Note that `filter` will be applied to the created option too. And make sure the value of the created option is not the same as any other option. | -| on-focus | `() => void` | `undefined` | Selection focus. | -| on-scroll | `(e: ScrollEvent) => void` | `undefined` | Menu scroll. | -| on-search | `(value: string) => void` | `undefined` | | -| on-update:value | `(value: Array \| string \| number \| null) => void` | `undefined` | Callback of value updating. | +| on-focus | `() => void` | `undefined` | Callback triggered when selection focus. | +| on-scroll | `(e: ScrollEvent) => void` | `undefined` | Callback triggered when menu scroll. | +| on-search | `(value: string) => void` | `undefined` | Callback triggered when search. | +| on-update:value | `(value: Array \| string \| number \| null) => void` | `undefined` | Callback triggered when value updating. | ### SelectOption Properties @@ -76,11 +76,11 @@ render-tag | Name | Type | Description | | --- | --- | --- | -| children | `Array` | | +| children | `Array` | Child select options. | | label | `string \| ((option: SelectGroupOption) => VNodeChild)` | Label of the group option. | | key | `string \| number` | Should be unique in options. | | render | `(info: { node: VNode }) => VNodeChild` | Render the entire option. | -| type | `'group'` | | +| type | `'group'` | Type of the group option. | ### Select Slots diff --git a/src/select/demos/zhCN/index.demo-entry.md b/src/select/demos/zhCN/index.demo-entry.md index e8ba27510..ddbb3c459 100644 --- a/src/select/demos/zhCN/index.demo-entry.md +++ b/src/select/demos/zhCN/index.demo-entry.md @@ -49,7 +49,7 @@ options-change-debug | max-tag-count | `number \| 'responsive'` | `undefined` | 多选标签的最大显示数量,`responsive` 会将所有标签保持在一行 | | multiple | `boolean` | `false` | 是否为多选 | | options | `Array` | `[]` | 配置选项内容,详情见 SelectOption Properties | -| placeholder | `string` | `'请选择'` | | +| placeholder | `string` | `'请选择'` | 提示信息 | | remote | `boolean` | `false` | 是否要异步获取选项。注意如果设定了,那么 `filter` 和 `tag` 都不会对 `options` 生效。这个时候你在全权控制 `options` | | render-label | `(option: SelectOption \| SelectGroupOption, selected: boolean) => VNodeChild` | `undefined` | 选项标签渲染函数 | | render-option | `(info: { node: VNode, option: SelectOption \| SelectGroupOption, selected: boolean } }` | `undefined` | 选项的渲染函数 | @@ -60,12 +60,12 @@ options-change-debug | tag | `boolean` | `false` | 是否可以创建新的选项,需要和 `filterable` 一起使用 | | value | `Array \| string \| number \| null` | `undefined` | 受控模式下的值 | | virtual-scroll | `boolean` | `true` | 是否启用虚拟滚动 | -| on-blur | `() => void` | `undefined` | 选择器 Blur 时发出 | +| on-blur | `() => void` | `undefined` | `blur` 时执行的回调 | | on-create | `(label: string) => SelectOption` | `label => ({ label, value: label })` | 在输入内容时如何创建一个选项。注意 `filter` 对这个生成的选项同样会生效。同时确保这个选项和其他选项的 `value` 不要有重复 | -| on-focus | `() => void` | `undefined` | 选择器 Focus 时发出 | -| on-scroll | `(e: ScrollEvent) => void` | `undefined` | 选择菜单在滚动 | -| on-search | `(value: string) => void` | `undefined` | | -| on-update:value | `(value: Array \| string \| number \| null) => void` | `undefined` | 值更新的回调 | +| on-focus | `() => void` | `undefined` | `focus` 时执行的回调 | +| on-scroll | `(e: ScrollEvent) => void` | `undefined` | 滚动时执行的回调 | +| on-search | `(value: string) => void` | `undefined` | 搜索时执行的回调 | +| on-update:value | `(value: Array \| string \| number \| null) => void` | `undefined` | 值更新时执行的回调 | ### SelectOption Properties @@ -74,7 +74,7 @@ options-change-debug | class | `string` | 自定义一个选项的类名 | | disabled | `boolean` | 是否禁用一个选项 | | label | `string \| ((option: SelectOption, selected: boolean) => VNodeChild)` | 选项的标签,注意如果你使用了渲染函数,默认的过滤器将会过滤该选项 | -| render | `(info: { node: VNode, option: SelectOption, selected: boolean }) => VNodeChild` | Render the entire option. | +| render | `(info: { node: VNode, option: SelectOption, selected: boolean }) => VNodeChild` | 渲染整个选项 | | style | `string \| object` | 自定义一个选项的样式 | | value | `string \| number` | 在选项中应该是唯一的 | @@ -82,11 +82,11 @@ options-change-debug | 名称 | 类型 | 说明 | | --- | --- | --- | -| children | `Array` | | +| children | `Array` | 子选项组 | | label | `string \| ((option: SelectGroupOption) => VNodeChild)` | 选项组的标签 | | key | `string \| number` | 在选项中应该是唯一的 | -| render | `(info: { node: VNode, option: SelectOption, selected: boolean } }) => VNodeChild` | Render the entire option. | -| type | `'group'` | | +| render | `(info: { node: VNode, option: SelectOption, selected: boolean } }) => VNodeChild` | 渲染整个选项 | +| type | `'group'` | 选项组的类型 | ### Select Slots From b24994f8f248d7634669949c867cae5f8d2e9482 Mon Sep 17 00:00:00 2001 From: songjianet <1778651752@qq.com> Date: Tue, 27 Jul 2021 23:44:51 +0800 Subject: [PATCH 3/5] docs(avatar): api table (#678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(avatar): 完善头像组件的说明文档和用例 * docs(avatar): 更新测试用例的说明 * Apply suggestions from code review Co-authored-by: Yugang Cao <34439652+Talljack@users.noreply.github.com> Co-authored-by: 07akioni <07akioni2@gmail.com> Co-authored-by: Yugang Cao <34439652+Talljack@users.noreply.github.com> --- src/avatar/demos/enUS/badge.demo.md | 2 +- src/avatar/demos/enUS/index.demo-entry.md | 3 ++- src/avatar/demos/enUS/name-size.demo.md | 2 +- src/avatar/demos/enUS/shape.demo.md | 8 ++++---- src/avatar/demos/zhCN/badge.demo.md | 2 +- src/avatar/demos/zhCN/index.demo-entry.md | 3 ++- src/avatar/demos/zhCN/name-size.demo.md | 2 +- src/avatar/demos/zhCN/shape.demo.md | 8 ++++---- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/avatar/demos/enUS/badge.demo.md b/src/avatar/demos/enUS/badge.demo.md index 01ebe6894..f4b327c65 100644 --- a/src/avatar/demos/enUS/badge.demo.md +++ b/src/avatar/demos/enUS/badge.demo.md @@ -1,6 +1,6 @@ # Badge -Using it with badge would be nice (if you like tons of notifications). +Using it with `badge` would be nice (if you like tons of notifications). ```html diff --git a/src/avatar/demos/enUS/index.demo-entry.md b/src/avatar/demos/enUS/index.demo-entry.md index 9d891a61e..4906b4cd6 100644 --- a/src/avatar/demos/enUS/index.demo-entry.md +++ b/src/avatar/demos/enUS/index.demo-entry.md @@ -17,9 +17,10 @@ name-size | Name | Type | Default | Description | | --- | --- | --- | --- | -| object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `fill` | Object-fit type of the image in the container. | +| object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `'fill'` | Object-fit type of the image in the container. | | size | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | Avatar's size. | | src | `string` | `undefined` | Avatar's source. | +| color | `string` | `undefined` | The background color of the avatar. | | round | `boolean` | `false` | Whether to display a rounded avatar. | | on-error | `(e: Event) => void` | `undefined` | Callback executed when the avatar image fails to load. | diff --git a/src/avatar/demos/enUS/name-size.demo.md b/src/avatar/demos/enUS/name-size.demo.md index faf4516d4..888ed186c 100644 --- a/src/avatar/demos/enUS/name-size.demo.md +++ b/src/avatar/demos/enUS/name-size.demo.md @@ -6,7 +6,7 @@ Words' sizing would be auto adjusted in avatar. {{ value }} - {{ value }} + {{ value }} diff --git a/src/avatar/demos/enUS/shape.demo.md b/src/avatar/demos/enUS/shape.demo.md index 78b9bb29f..052368b3f 100644 --- a/src/avatar/demos/enUS/shape.demo.md +++ b/src/avatar/demos/enUS/shape.demo.md @@ -5,22 +5,22 @@ Avatar can be circle shaped. ```html diff --git a/src/avatar/demos/zhCN/badge.demo.md b/src/avatar/demos/zhCN/badge.demo.md index 31abfbc36..49bf4ce7d 100644 --- a/src/avatar/demos/zhCN/badge.demo.md +++ b/src/avatar/demos/zhCN/badge.demo.md @@ -1,6 +1,6 @@ # 标记 -和 Badge 一起用也挺好的 (如果你喜欢看到一堆一堆的推送)。 +和 `Badge` 一起用也挺好的 (如果你喜欢看到一堆一堆的推送)。 ```html diff --git a/src/avatar/demos/zhCN/index.demo-entry.md b/src/avatar/demos/zhCN/index.demo-entry.md index 1f71da587..4db36e2dd 100644 --- a/src/avatar/demos/zhCN/index.demo-entry.md +++ b/src/avatar/demos/zhCN/index.demo-entry.md @@ -17,9 +17,10 @@ name-size | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | -| object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `fill` | 头像的图片在容器内的的适应类型 | +| object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `'fill'` | 头像的图片在容器内的的适应类型 | | size | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | 头像的尺寸 | | src | `string` | `undefined` | 头像的地址 | +| color | `string` | `undefined` | 头像的背景色 | | round | `boolean` | `false` | 头像是否圆形 | | on-error | `(e: Event) => void` | `undefined` | 头像的图片加载失败执行的回调 | diff --git a/src/avatar/demos/zhCN/name-size.demo.md b/src/avatar/demos/zhCN/name-size.demo.md index 3cc9b0e77..d7f61a202 100644 --- a/src/avatar/demos/zhCN/name-size.demo.md +++ b/src/avatar/demos/zhCN/name-size.demo.md @@ -6,7 +6,7 @@ {{ value }} - {{ value }} + {{ value }} diff --git a/src/avatar/demos/zhCN/shape.demo.md b/src/avatar/demos/zhCN/shape.demo.md index 2db3cc3eb..52ed6a2b9 100644 --- a/src/avatar/demos/zhCN/shape.demo.md +++ b/src/avatar/demos/zhCN/shape.demo.md @@ -5,22 +5,22 @@ ```html From c4541cb85616b21d491c14936c02e7b2b481945f Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Tue, 27 Jul 2021 23:47:19 +0800 Subject: [PATCH 4/5] docs(avatar): fix api table order --- src/avatar/demos/enUS/index.demo-entry.md | 2 +- src/avatar/demos/zhCN/index.demo-entry.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/avatar/demos/enUS/index.demo-entry.md b/src/avatar/demos/enUS/index.demo-entry.md index 4906b4cd6..64ba7e68b 100644 --- a/src/avatar/demos/enUS/index.demo-entry.md +++ b/src/avatar/demos/enUS/index.demo-entry.md @@ -17,10 +17,10 @@ name-size | Name | Type | Default | Description | | --- | --- | --- | --- | +| color | `string` | `undefined` | The background color of the avatar. | | object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `'fill'` | Object-fit type of the image in the container. | | size | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | Avatar's size. | | src | `string` | `undefined` | Avatar's source. | -| color | `string` | `undefined` | The background color of the avatar. | | round | `boolean` | `false` | Whether to display a rounded avatar. | | on-error | `(e: Event) => void` | `undefined` | Callback executed when the avatar image fails to load. | diff --git a/src/avatar/demos/zhCN/index.demo-entry.md b/src/avatar/demos/zhCN/index.demo-entry.md index 4db36e2dd..5e51ac02a 100644 --- a/src/avatar/demos/zhCN/index.demo-entry.md +++ b/src/avatar/demos/zhCN/index.demo-entry.md @@ -17,10 +17,10 @@ name-size | 名称 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | +| color | `string` | `undefined` | 头像的背景色 | | object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `'fill'` | 头像的图片在容器内的的适应类型 | | size | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | 头像的尺寸 | | src | `string` | `undefined` | 头像的地址 | -| color | `string` | `undefined` | 头像的背景色 | | round | `boolean` | `false` | 头像是否圆形 | | on-error | `(e: Event) => void` | `undefined` | 头像的图片加载失败执行的回调 | From e2af79d36bc41b99c7a0d6ad988a22be4d82ca61 Mon Sep 17 00:00:00 2001 From: XieZongChen <46394163+amadeus711@users.noreply.github.com> Date: Tue, 27 Jul 2021 11:10:42 -0500 Subject: [PATCH 5/5] docs(thing): slots docs (#677) --- src/thing/demos/enUS/index.demo-entry.md | 16 +++++++++------- src/thing/demos/zhCN/index.demo-entry.md | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/thing/demos/enUS/index.demo-entry.md b/src/thing/demos/enUS/index.demo-entry.md index bf285aa14..dfd71f24c 100644 --- a/src/thing/demos/enUS/index.demo-entry.md +++ b/src/thing/demos/enUS/index.demo-entry.md @@ -23,10 +23,12 @@ indent ## Slots -| Name | Parameters | Description | -| ------------ | ---------- | ------------------------------------- | -| action | `()` | Operating area slot. | -| default | `()` | Content information. | -| description | `()` | Description information. | -| header-extra | `()` | Additional information in the header. | -| header | `()` | Header information. | +| Name | Parameters | Description | +| ------------ | ---------- | -------------------- | +| action | `()` | Action's slot. | +| avatar | `()` | Avatar's slot. | +| default | `()` | Content's slot. | +| description | `()` | Description's slot. | +| footer | `()` | Footer's slot. | +| header-extra | `()` | Header extra's slot. | +| header | `()` | Header's slot. | diff --git a/src/thing/demos/zhCN/index.demo-entry.md b/src/thing/demos/zhCN/index.demo-entry.md index ea7afed71..7ad29fade 100644 --- a/src/thing/demos/zhCN/index.demo-entry.md +++ b/src/thing/demos/zhCN/index.demo-entry.md @@ -23,10 +23,12 @@ indent ## Slots -| 名称 | 参数 | 说明 | -| ------------ | ---- | -------------- | -| action | `()` | 操作区域插槽 | -| default | `()` | 内容信息 | -| description | `()` | 描述信息 | -| header-extra | `()` | 头部的附加信息 | -| header | `()` | 头部信息 | +| 名称 | 参数 | 说明 | +| ------------ | ---- | ---------------- | +| action | `()` | 操作区域插槽 | +| avatar | `()` | 头像区域插槽 | +| default | `()` | 内容区域插槽 | +| description | `()` | 描述区域插槽 | +| footer | `()` | 尾部区域插槽 | +| header-extra | `()` | 头部附加区域插槽 | +| header | `()` | 头部区域插槽 |