From 5264c0b30b60763b8c7aa00326685c2446926b04 Mon Sep 17 00:00:00 2001
From: songjianet <1778651752@qq.com>
Date: Fri, 16 Jul 2021 23:23:21 +0800
Subject: [PATCH] =?UTF-8?q?docs(mention):=20=E6=9B=B4=E6=96=B0=E6=8F=90?=
=?UTF-8?q?=E5=8F=8A=E7=BB=84=E4=BB=B6=E7=9A=84=E8=AF=B4=E6=98=8E=E6=96=87?=
=?UTF-8?q?=E6=A1=A3=20(#525)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* docs(icon): 更新图标组件的说明文档
* docs(pageHeader): 更新页头组件的说明文档
* docs(pageHeader): 更新页头组件的文档中的错别字
* docs(typography): 更新排印组件的说明文档
* Update src/typography/demos/zhCN/index.demo-entry.md
* docs(mention): 更新提及组件的说明文档
* docs(mention): 更新提及组件的一部分参数说明
Co-authored-by: 07akioni <07akioni2@gmail.com>
---
src/loading-bar/src/use-loading-bar.ts | 5 +-
src/mention/demos/enUS/index.demo-entry.md | 46 +++++++++----------
src/mention/demos/zhCN/index.demo-entry.md | 46 +++++++++----------
src/notification/src/NotificationProvider.tsx | 10 ++--
src/tag/demos/enUS/checkable.demo.md | 4 +-
src/upload/demos/enUS/on-finish.demo.md | 2 +-
src/upload/demos/zhCN/on-finish.demo.md | 2 +-
7 files changed, 57 insertions(+), 58 deletions(-)
diff --git a/src/loading-bar/src/use-loading-bar.ts b/src/loading-bar/src/use-loading-bar.ts
index cfa6dfaad..e128bfba7 100644
--- a/src/loading-bar/src/use-loading-bar.ts
+++ b/src/loading-bar/src/use-loading-bar.ts
@@ -6,7 +6,10 @@ import { throwError } from '../../_utils'
export function useLoadingBar (): LoadingBarApiInjection {
const loadingBar = inject(loadingBarApiInjectionKey, null)
if (loadingBar === null) {
- throwError('use-loading-bar', 'No outer founded.')
+ throwError(
+ 'use-loading-bar',
+ 'No outer founded.'
+ )
}
return loadingBar
}
diff --git a/src/mention/demos/enUS/index.demo-entry.md b/src/mention/demos/enUS/index.demo-entry.md
index e16ddfc3f..8534548ec 100644
--- a/src/mention/demos/enUS/index.demo-entry.md
+++ b/src/mention/demos/enUS/index.demo-entry.md
@@ -19,31 +19,31 @@ Mention is provided after `v2.2.0`.
| Name | Type | Default | Description |
| --- | --- | --- | --- |
-| autosize | `boolean \| { maxRows?: number, minRows?: number }` | `false` | |
-| options | `MentionOption[]` | `[]` | |
-| type | `'input' \| 'textarea'` | `'input'` | |
+| autosize | `boolean \| { maxRows?: number, minRows?: number }` | `false` | Autosize. |
+| options | `MentionOption[]` | `[]` | Mention Options list. |
+| type | `'input' \| 'textarea'` | `'input'` | Input type. |
| separator | `string` | `' '` | Char to split mentions whose length must be 1. |
-| bordered | `boolean` | `true` | |
-| disabled | `boolean` | `false` | |
-| value | `string \| null` | `undefined` | |
-| default-value | `string` | `''` | |
-| loading | `boolean` | `false` | |
+| bordered | `boolean` | `true` | Whether to display the border of the input box. |
+| disabled | `boolean` | `false` | Whether to set the input box to be disabled. |
+| value | `string \| null` | `undefined` | Input value. |
+| default-value | `string` | `''` | Input default value. |
+| loading | `boolean` | `false` | Whether the selection panel of mentions shows the loading status. |
| prefix | `string \| string[]` | `'@'` | Prefix char to trigger mentions whose length must be 1. |
-| placeholder | `string` | `''` | |
-| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
-| on-update:value | `(value: string) => void` | `undefined` | |
-| on-select | `(option: MentionOption, prefix: string) => void` | `undefined` | |
-| on-focus | `(e: FocusEvent) => void` | `undefined` | |
-| on-search | `(pattern: string, prefix: string) => void` | `undefined` | |
-| on-blur | `(e: FocusEvent) => void` | `undefined` | |
+| placeholder | `string` | `''` | Input placeholder. |
+| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Input size. |
+| on-update:value | `(value: string) => void` | `undefined` | Triggered when the input box value is updated. |
+| on-select | `(option: MentionOption, prefix: string) => void` | `undefined` | Triggered when the input box is selected. |
+| on-focus | `(e: FocusEvent) => void` | `undefined` | Triggered when the input box gets focus. |
+| on-search | `(pattern: string, prefix: string) => void` | `undefined` | Triggered when searching in the input box. |
+| on-blur | `(e: FocusEvent) => void` | `undefined` | Triggered when the input box loses focus. |
### MentionOption Properties
-| Name | Type | Description |
-| -------- | --------------------------------------- | ---------------- |
-| class | `string` | |
-| disabled | `boolean` | |
-| label | `string` | |
-| render | `(option: MentionOption) => VNodeChild` | |
-| style | `string` | |
-| value | `string` | Should be unique |
+| Name | Type | Description |
+| --- | --- | --- |
+| class | `string` | Option class name. |
+| disabled | `boolean` | Option disabled status. |
+| label | `string` | Option label. |
+| render | `(option: MentionOption) => VNodeChild` | Support custom options via `render` rendering function. |
+| style | `string` | Option style. |
+| value | `string` | Should be unique. |
diff --git a/src/mention/demos/zhCN/index.demo-entry.md b/src/mention/demos/zhCN/index.demo-entry.md
index 59de0aafb..07ca09837 100644
--- a/src/mention/demos/zhCN/index.demo-entry.md
+++ b/src/mention/demos/zhCN/index.demo-entry.md
@@ -19,31 +19,31 @@ Mention 在 `v2.2.0` 及以后可用。
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| autosize | `boolean \| { maxRows?: number, minRows?: number }` | `false` | |
-| options | `MentionOption[]` | `[]` | |
-| type | `'input' \| 'textarea'` | `'input'` | |
+| autosize | `boolean \| { maxRows?: number, minRows?: number }` | `false` | 自动换行 |
+| options | `MentionOption[]` | `[]` | 选项列表 |
+| type | `'input' \| 'textarea'` | `'input'` | 输入框类型 |
| separator | `string` | `' '` | 切分提及使用的字符,长度必须为 1 |
-| bordered | `boolean` | `true` | |
-| disabled | `boolean` | `false` | |
-| value | `string \| null` | `undefined` | |
-| default-value | `string` | `''` | |
-| loading | `boolean` | `false` | |
+| bordered | `boolean` | `true` | 是否显示输入框边框 |
+| disabled | `boolean` | `false` | 是否设置输入框为禁用状态 |
+| value | `string \| null` | `undefined` | 输入框的值 |
+| default-value | `string` | `''` | 输入框的默认值 |
+| loading | `boolean` | `false` | 选择面板是否显示加载状态 |
| prefix | `string \| string[]` | `'@'` | 触发提及的前缀,长度必须为 1 |
-| placeholder | `string` | `''` | |
-| size | `'small' \| 'medium' \| 'large'` | `'medium'` | |
-| on-update:value | `(value: string) => void` | `undefined` | |
-| on-select | `(option: MentionOption, prefix: string) => void` | `undefined` | |
-| on-focus | `(e: FocusEvent) => void` | `undefined` | |
-| on-search | `(pattern: string, prefix: string) => void` | `undefined` | |
-| on-blur | `(e: FocusEvent) => void` | `undefined` | |
+| placeholder | `string` | `''` | 输入框的占位符 |
+| size | `'small' \| 'medium' \| 'large'` | `'medium'` | 输入框的大小 |
+| on-update:value | `(value: string) => void` | `undefined` | 输入框值发生更新时触发 |
+| on-select | `(option: MentionOption, prefix: string) => void` | `undefined` | 输入框的选中时触发 |
+| on-focus | `(e: FocusEvent) => void` | `undefined` | 输入框获得焦点时触发 |
+| on-search | `(pattern: string, prefix: string) => void` | `undefined` | 输入框搜索时触发 |
+| on-blur | `(e: FocusEvent) => void` | `undefined` | 输入框失去焦点时触发 |
### MentionOption Properties
-| 名称 | 类型 | 说明 |
-| -------- | --------------------------------------- | -------------------- |
-| class | `string` | |
-| disabled | `boolean` | |
-| label | `string` | |
-| render | `(option: MentionOption) => VNodeChild` | |
-| style | `string` | |
-| value | `string` | 在选项中应该是唯一的 |
+| 名称 | 类型 | 说明 |
+| --- | --- | --- |
+| class | `string` | 选项的自定义类名 |
+| disabled | `boolean` | 选项是否禁用 |
+| label | `string` | 选项的标签 |
+| render | `(option: MentionOption) => VNodeChild` | 支持通过 `render` 渲染函数自定义选项 |
+| style | `string` | 选项的样式 |
+| value | `string` | 在选项中应该是唯一的 |
diff --git a/src/notification/src/NotificationProvider.tsx b/src/notification/src/NotificationProvider.tsx
index 5ec513d84..28d50ac4f 100644
--- a/src/notification/src/NotificationProvider.tsx
+++ b/src/notification/src/NotificationProvider.tsx
@@ -33,9 +33,8 @@ export interface NotificationProviderInjection {
mergedThemeRef: Ref>
}
-export const notificationProviderInjectionKey: InjectionKey = Symbol(
- 'notificationProvider'
-)
+export const notificationProviderInjectionKey: InjectionKey =
+ Symbol('notificationProvider')
type Create = (options: NotificationOptions) => NotificationReactive
type TypedCreate = (
@@ -54,9 +53,8 @@ export interface NotificationApiInjection {
export type NotificationProviderInst = NotificationApiInjection
-export const notificationApiInjectionKey: InjectionKey = Symbol(
- 'notificationApi'
-)
+export const notificationApiInjectionKey: InjectionKey =
+ Symbol('notificationApi')
export type NotificationReactive = {
readonly key: string
diff --git a/src/tag/demos/enUS/checkable.demo.md b/src/tag/demos/enUS/checkable.demo.md
index 39ca1eb5e..620c1cace 100644
--- a/src/tag/demos/enUS/checkable.demo.md
+++ b/src/tag/demos/enUS/checkable.demo.md
@@ -8,9 +8,7 @@ It can be checkable.
Yes It Is
I'm Down
Yesterday
-
- I'm Looking Through You
-
+ I'm Looking Through You
```
diff --git a/src/upload/demos/enUS/on-finish.demo.md b/src/upload/demos/enUS/on-finish.demo.md
index dfb26c9a4..afde5c379 100644
--- a/src/upload/demos/enUS/on-finish.demo.md
+++ b/src/upload/demos/enUS/on-finish.demo.md
@@ -15,7 +15,7 @@ You can change file's property when upload finishes.
import { useMessage } from 'naive-ui'
export default {
- setup() {
+ setup () {
const message = useMessage()
const handleFinish = ({ file, event }) => {
message.success(event.target.response)
diff --git a/src/upload/demos/zhCN/on-finish.demo.md b/src/upload/demos/zhCN/on-finish.demo.md
index c83ebcd57..d6954703c 100644
--- a/src/upload/demos/zhCN/on-finish.demo.md
+++ b/src/upload/demos/zhCN/on-finish.demo.md
@@ -15,7 +15,7 @@
import { useMessage } from 'naive-ui'
export default {
- setup() {
+ setup () {
const message = useMessage()
const handleFinish = ({ file, event }) => {
message.success(event.target.response)