This commit is contained in:
07akioni 2024-05-03 23:31:29 +08:00
parent 034055a524
commit 136dbe91e7
41 changed files with 178 additions and 237 deletions

View File

@ -1,6 +1,6 @@
# CHANGELOG
## NEXT_VERSION
## 2.38.2
`2024-05-03`
@ -18,6 +18,7 @@
### Features
- `n-watermark` support multi-lines in content.
- Adds `n-infinite-scroll` component.
- `n-watermark` adds `text-align` prop.
- `n-qr-code` adds `type` prop, Customize rendering output by setting `type`, providing two options: `canvas` and `svg`.
- `n-card` adds `action`, `content`, `cover`, `footer` and `header-extra` props.
@ -192,7 +193,6 @@
- `n-tree-select` adds `override-default-node-click-behavior` prop.
- Adds `n-flex` component.
- `n-pagination` adds `show-quick-jump-dropdown` prop, closes [#5251](https://github.com/tusen-ai/naive-ui/issues/5251).
- Adds `n-infinite-scroll` component.
## 2.36.0

View File

@ -1,6 +1,6 @@
# CHANGELOG
## NEXT_VERSION
## 2.38.2
`2024-05-03`
@ -17,6 +17,7 @@
### Features
- `n-watermark` 支持多行文本
- 新增 `n-infinite-scroll` 组件
- `n-watermark` 新增 `text-align` 属性
- `n-qr-code` 新增 `type` 属性,设置 `type` 自定义渲染结果,提供 `canvas``svg` 两个选项
- `n-card` 新增 `action`、`content`、`cover`、`footer`、`header-extra` 属性
@ -192,7 +193,6 @@
- `n-tree-select` 新增 `override-default-node-click-behavior` 属性
- 新增 `n-flex` 组件
- `n-pagination` 新增 `show-quick-jump-dropdown` 属性,关闭 [#5251](https://github.com/tusen-ai/naive-ui/issues/5251)
- 新增 `n-infinite-scroll` 组件
## 2.36.0

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.38.1",
"version": "2.38.2",
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
"main": "lib/index.js",
"module": "es/index.mjs",

View File

@ -45,7 +45,7 @@ embedded.vue
| segmented | `boolean \| { [part in 'content' \| 'footer' \| 'action']?: boolean \| 'soft' }` | `false` | Segment divider settings of the card. | |
| size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | Card size. | |
| tag | `string` | `'div'` | What tag need the card be rendered as. | 2.34.3 |
| title | `string \| (() => VNodeChild)` | `undefined` | Card title. | Render function since NEXT_VERSION |
| title | `string \| (() => VNodeChild)` | `undefined` | Card title. | Render function since 2.38.2 |
| on-close | `() => void` | `undefined` | Callback function triggered upon closing the card. | |
### Card Slots

View File

@ -47,7 +47,7 @@ embedded-debug.vue
| segmented | `boolean \| { [part in 'content' \| 'footer' \| 'action']?: boolean \| 'soft' }` | `false` | 卡片的分段区域设置 | |
| size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | 卡片的尺寸 | |
| tag | `string` | `'div'` | 卡片组件要渲染为什么标签 | 2.34.3 |
| title | `string \| (() => VNodeChild)` | `undefined` | 卡片的标题,,可以是 render 函数 | NEXT_VERSION 支持 render 函数 |
| title | `string \| (() => VNodeChild)` | `undefined` | 卡片的标题,,可以是 render 函数 | 2.38.2 支持 render 函数 |
| on-close | `() => void` | `undefined` | 点击卡片关闭图标时的回调 | |
### Card Slots

View File

@ -39,7 +39,7 @@ status.vue
| filterable | `boolean` | `false` | Note: If `remote` is set, this won't have any effect. | |
| filter | `(pattern: string, option: CascaderOption, path: CascaderOption[]) => boolean` | A string based filter algorithm. | Filter function of the cascader. | |
| filter-menu-props | `HTMLAttributes` | `undefined` | The filter menu's dom props. | 2.27.0 |
| get-column-style | `(detail: { level: number }) => string \| object` | `undefined` | Function that resolves column style. `level` starts from `0`. | NEXT_VERSION |
| get-column-style | `(detail: { level: number }) => string \| object` | `undefined` | Function that resolves column style. `level` starts from `0`. | 2.38.2 |
| value-field | `string` | `'value'` | The value field in `CascaderOption`. | |
| label-field | `string` | `'label'` | The label field in `CascaderOption`. | |
| max-tag-count | `number \| 'responsive'` | `undefined` | Max tag count in multiple select mode. `responsive` will keep all the tags in single line. | |
@ -49,9 +49,9 @@ status.vue
| placeholder | `string` | `'Please Select'` | Placeholder text. | |
| placement | `'top-start' \| 'top' \| 'top-end' \| 'right-start' \| 'right' \| 'right-end' \| 'bottom-start' \| 'bottom' \| 'bottom-end' \| 'left-start' \| 'left' \| 'left-end'` | `'bottom-start'` | Cascader placement. | 2.25.0 |
| remote | `boolean` | `false` | Whether to obtain data remotely. | |
| render-prefix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | Render function of all the options' prefix. | NEXT_VERSION |
| render-prefix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | Render function of all the options' prefix. | 2.38.2 |
| render-label | `(option: CascaderOption, checked: boolean) => VNodeChild` | `undefined` | Render function for cascader menu option label. | 2.24.0 |
| render-suffix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | Render function of all the options' suffix. | NEXT_VERSION |
| render-suffix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | Render function of all the options' suffix. | 2.38.2 |
| separator | `string` | `' / '` | Selected option path value separator (used with `show-path`). | |
| show | `boolean` | `undefined` | Whether to show the menu. | |
| show-path | `boolean` | `true` | Whether to show the selected options as a path. | |

View File

@ -40,7 +40,7 @@ default-value-debug.vue
| filterable | `boolean` | `false` | `remote` 被设定时不生效 | |
| filter | `(pattern: string, option: CascaderOption, path: CascaderOption[]) => boolean` | 一个基于字符串的过滤算法 | 过滤选项的函数 | |
| filter-menu-props | `HTMLAttributes` | `undefined` | 可过滤菜单的 DOM 属性 | 2.27.0 |
| get-column-style | `(detail: { level: number }) => string \| object` | `undefined` | 获取列样式的函数,`level` 从 `0` 开始 | NEXT_VERSION |
| get-column-style | `(detail: { level: number }) => string \| object` | `undefined` | 获取列样式的函数,`level` 从 `0` 开始 | 2.38.2 |
| value-field | `string` | `'value'` | 替代 `CascaderOption` 中的 value 字段名 | |
| label-field | `string` | `'label'` | 替代 `CascaderOption` 中的 label 字段名 | |
| max-tag-count | `number \| 'responsive'` | `undefined` | 多选标签的最大显示数量,`responsive` 会将所有标签保持在一行 | |
@ -50,9 +50,9 @@ default-value-debug.vue
| placeholder | `string` | `'请选择'` | 提示信息 | |
| placement | `'top-start' \| 'top' \| 'top-end' \| 'right-start' \| 'right' \| 'right-end' \| 'bottom-start' \| 'bottom' \| 'bottom-end' \| 'left-start' \| 'left' \| 'left-end'` | `'bottom-start'` | 弹出位置 | 2.25.0 |
| remote | `boolean` | `false` | 是否远程获取数据 | |
| render-prefix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | 节点前缀的渲染函数 | NEXT_VERSION |
| render-prefix | `(info: { option: CascaderOption, node: VNode \| null, checked: boolean }) => VNodeChild` | `undefined` | 节点前缀的渲染函数 | 2.38.2 |
| render-label | `(option: CascaderOption, checked: boolean) => VNodeChild` | `undefined` | Cascader 菜单选项标签渲染函数 | 2.24.0 |
| render-suffix | `(info: { option: CascaderOption, checked: boolean }) => VNodeChild` | `undefined` | 节点后缀的渲染函数 | NEXT_VERSION |
| render-suffix | `(info: { option: CascaderOption, checked: boolean }) => VNodeChild` | `undefined` | 节点后缀的渲染函数 | 2.38.2 |
| separator | `string` | `' / '` | 数据分隔符 | |
| show | `boolean` | `undefined` | 是否打开菜单 | |
| show-path | `boolean` | `true` | 是否在选择器中显示选项路径 | |

View File

@ -53,7 +53,7 @@ panel.vue
| show | `boolean` | `undefined` | Whether to show panel. | 2.28.3 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Date picker size. | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | Validation status. | 2.27.0 |
| time-picker-format | `string \| undefined` | `undefined` | Format of the binding value in time picker inside date picker of type `'datetime'` and `'datetimerange'`. See [format](https://date-fns.org/v2.23.0/docs/format). | NEXT_VERSION |
| time-picker-format | `string \| undefined` | `undefined` | Format of the binding value in time picker inside date picker of type `'datetime'` and `'datetimerange'`. See [format](https://date-fns.org/v2.23.0/docs/format). | 2.38.2 |
| to | `string \| HTMLElement \| false` | `body` | Container node of the panel. `false` will keep it not detached. | |
| type | `'date' \| 'datetime' \| 'daterange' \| 'datetimerange' \| 'month' \| 'monthrange' \| 'year' \| 'quarter' \| 'week'` | `'date'` | Date picker type. | `'quarter'` v2.22.0, `'monthrange'` 2.28.3 |
| value | `number \| [number, number] \| null` | `undefined` | Value of the date picker when being manually set. | |

View File

@ -54,7 +54,7 @@ form-debug.vue
| show | `boolean` | `undefined` | 是否展示面板 | 2.28.3 |
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | 尺寸 | |
| status | `'success' \| 'warning' \| 'error'` | `undefined` | 验证状态 | 2.27.0 |
| time-picker-format | `string \| undefined` | `undefined` | 日期面板内时间的显示方式,详情见 [format](https://date-fns.org/v2.23.0/docs/format) | NEXT_VERSION |
| time-picker-format | `string \| undefined` | `undefined` | 日期面板内时间的显示方式,详情见 [format](https://date-fns.org/v2.23.0/docs/format) | 2.38.2 |
| to | `string \| HTMLElement \| false` | `body` | 面板的容器节点,`false` 会待在原地 | |
| type | `'date' \| 'datetime' \| 'daterange' \| 'datetimerange' \| 'month' \| 'monthrange' \| 'year' \| 'quarter' \| 'week'` | `'date'` | Date Picker 的类型 | `'quarter'` v2.22.0, `'monthrange'` 2.28.3 |
| value | `number \| [number, number] \| null` | `undefined` | Date Picker 的值 | |

View File

@ -65,8 +65,8 @@ use-dialog-reactive-list.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| action | `() => VNodeChild` | `undefined` | Content of the operation area, must be a render function. | |
| actionClass | `string` | The class name of the action area. | NEXT_VERSION |
| actionStyle | `Object \| string` | The style of the action area. | NEXT_VERSION |
| actionClass | `string` | The class name of the action area. | 2.38.2 |
| actionStyle | `Object \| string` | The style of the action area. | 2.38.2 |
| autoFocus | `boolean` | `true` | Whether to focus the first focusable element inside modal. | 2.28.3 |
| blockScroll | `boolean` | `true` | Whether to disabled body scrolling when it's active. | 2.28.3 |
| bordered | `boolean` | `false` | Whether to show `border`. | |
@ -74,8 +74,8 @@ use-dialog-reactive-list.vue
| closable | `boolean` | `true` | Whether to show `close` icon. | |
| closeOnEsc | `boolean` | `true` | Whether to close the dialog when the Esc key is pressed | 2.26.4 |
| content | `string \| (() => VNodeChild)` | `undefined` | Content, can be a render function. | |
| contentClass | `string` | The class name of the content. | NEXT_VERSION |
| contentStyle | `Object \| string` | The style of the content. | NEXT_VERSION |
| contentClass | `string` | The class name of the content. | 2.38.2 |
| contentStyle | `Object \| string` | The style of the content. | 2.38.2 |
| iconPlacement | `'left' \| 'top'` | `'left'` | Icon placement. | |
| icon | `() => VNodeChild` | `undefined` | `Render` function of `icon`. | |
| loading | `boolean` | `false` | Whether to display `loading` status. | |
@ -87,8 +87,8 @@ use-dialog-reactive-list.vue
| showIcon | `boolean` | `true` | Whether to show `icon`. | |
| style | `string \| Object` | `undefined` | Style of the dialog. | |
| title | `string \| (() => VNodeChild)` | `undefined` | Title, can be a render function. | |
| titleClass | `string` | The class name of the content. | NEXT_VERSION |
| titleStyle | `Object \| string` | The style of the content. | NEXT_VERSION |
| titleClass | `string` | The class name of the content. | 2.38.2 |
| titleStyle | `Object \| string` | The style of the content. | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | `'mouse'` | The transform origin of the dialog's display animation. | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | `'warning'` | Dialog type. | |
| onAfterEnter | `() => void` | `undefined` | Callback on enter animation ends. | 2.33.0 |
@ -106,15 +106,15 @@ All the properties can be modified dynamically.
| Name | Type | Description | Version |
| --- | --- | --- | --- |
| actionClass | `string` | The class name of the action area. | NEXT_VERSION |
| actionStyle | `Object \| string` | The style of the action area. | NEXT_VERSION |
| actionClass | `string` | The class name of the action area. | 2.38.2 |
| actionStyle | `Object \| string` | The style of the action area. | 2.38.2 |
| bordered | `boolean` | Whether to show `border`. | |
| class | `any` | Class name of the dialog. | 2.33.0 |
| closable | `boolean` | Whether to show `close` icon. | |
| closeOnEsc | `boolean` | Whether to close dialog on Esc is pressed. | 2.26.4 |
| content | `string \| (() => VNodeChild)` | Content, can be a render function. | |
| contentClass | `string` | The class name of the content. | NEXT_VERSION |
| contentStyle | `Object \| string` | The style of the content. | NEXT_VERSION |
| contentClass | `string` | The class name of the content. | 2.38.2 |
| contentStyle | `Object \| string` | The style of the content. | 2.38.2 |
| iconPlacement | `'left' \| 'top'` | Icon placement. | |
| icon | `() => VNodeChild` | `Render` function of `icon`. | |
| loading | `boolean` | Whether to display `loading` status. | |
@ -126,8 +126,8 @@ All the properties can be modified dynamically.
| show-icon | `boolean` | Whether to show `icon`. | |
| style | `string \| Object` | Style of the dialog. | |
| title | `string \| (() => VNodeChild)` | Can be a render function. | |
| titleClass | `string` | The class name of the content. | NEXT_VERSION |
| titleStyle | `Object \| string` | The style of the content. | NEXT_VERSION |
| titleClass | `string` | The class name of the content. | 2.38.2 |
| titleStyle | `Object \| string` | The style of the content. | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | The transform origin of the dialog's display animation. | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | Dialog type. | |
| onAfterEnter | `() => void \| undefined` | Callback on enter animation ends. | 2.33.0 |
@ -147,13 +147,13 @@ All the properties can be modified dynamically.
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| action-class | `string` | `undefined` | The class name of the action area. | NEXT_VERSION |
| action-style | `Object \| string` | `undefined` | The style of the action area. | NEXT_VERSION |
| action-class | `string` | `undefined` | The class name of the action area. | 2.38.2 |
| action-style | `Object \| string` | `undefined` | The style of the action area. | 2.38.2 |
| bordered | `boolean` | `false` | Whether to show `border`. | |
| closable | `boolean` | `true` | Whether to show `close` icon. | |
| content | `string \| (() => VNodeChild)` | `undefined` | Can be a render function. | |
| content-class | `string` | `undefined` | The class name of the content. | NEXT_VERSION |
| content-style | `Object \| string` | `undefined` | The style of the content. | NEXT_VERSION |
| content-class | `string` | `undefined` | The class name of the content. | 2.38.2 |
| content-style | `Object \| string` | `undefined` | The style of the content. | 2.38.2 |
| icon-placement | `'left' \| 'top'` | `'left'` | Icon placement. | |
| icon | `() => VNodeChild` | `undefined` | `Render` function of icon. | |
| loading | `boolean` | `false` | Whether to display `loading` status. | |
@ -163,8 +163,8 @@ All the properties can be modified dynamically.
| positive-text | `string` | `undefined` | Corresponding button won't show if not set. | |
| show-icon | `boolean` | `true` | Whether to display the `icon`. | |
| title | `string \| (() => VNodeChild)` | `undefined` | Title, can be a render function. | |
| title-class | `string` | `undefined` | The class name of the content. | NEXT_VERSION |
| title-style | `Object \| string` | `undefined` | The style of the content. | NEXT_VERSION |
| title-class | `string` | `undefined` | The class name of the content. | 2.38.2 |
| title-style | `Object \| string` | `undefined` | The style of the content. | 2.38.2 |
| type | `'error \| 'success' \| 'warning' \| 'info'` | `'warning'` | Dialog type. | |
| on-close | `() => void` | `undefined` | Calback on close button clicked. | |
| on-negative-click | `(e: MouseEvent) => void` | `undefined` | Callback on positive button clicked. | |

View File

@ -67,8 +67,8 @@ rtl-debug.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| action | `() => VNodeChild` | `undefined` | 操作区域的内容,需要是渲染函数 | |
| actionClass | `string` | 操作区域的类名 | NEXT_VERSION |
| actionStyle | `Object \| string` | 操作区域的样式 | NEXT_VERSION |
| actionClass | `string` | 操作区域的类名 | 2.38.2 |
| actionStyle | `Object \| string` | 操作区域的样式 | 2.38.2 |
| autoFocus | `boolean` | `true` | 是否自动聚焦 Modal 第一个可聚焦的元素 | 2.28.3 |
| blockScroll | `boolean` | `true` | 是否在打开时禁用 body 滚动 | 2.28.3 |
| bordered | `boolean` | `false` | 是否显示 `border` | |
@ -76,8 +76,8 @@ rtl-debug.vue
| closable | `boolean` | `true` | 是否显示 `close` 图标 | |
| closeOnEsc | `boolean` | `true` | 是否在摁下 Esc 键的时候关闭对话框 | 2.26.4 |
| content | `string \| (() => VNodeChild)` | `undefined` | 对话框内容,可以是渲染函数 | |
| contentClass | `string` | 内容的类名 | NEXT_VERSION |
| contentStyle | `Object \| string` | 内容的样式 | NEXT_VERSION |
| contentClass | `string` | 内容的类名 | 2.38.2 |
| contentStyle | `Object \| string` | 内容的样式 | 2.38.2 |
| iconPlacement | `'left' \| 'top'` | `'left'` | 图标的位置 | |
| icon | `() => VNodeChild` | `undefined` | 对话框 `icon`, 需要是渲染函数 | |
| loading | `boolean` | `false` | 是否显示 `loading` 状态 | |
@ -89,8 +89,8 @@ rtl-debug.vue
| showIcon | `boolean` | `true` | 是否显示 `icon` | |
| style | `string \| Object` | `undefined` | 样式 | |
| title | `string \| (() => VNodeChild)` | `undefined` | 标题,可以是渲染函数 | |
| titleClass | `string` | 标题的类名 | NEXT_VERSION |
| titleStyle | `Object \| string` | 标题的样式 | NEXT_VERSION |
| titleClass | `string` | 标题的类名 | 2.38.2 |
| titleStyle | `Object \| string` | 标题的样式 | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | `'mouse'` | 对话框动画出现的位置 | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | `'warning'` | 对话框类型 | |
| onAfterEnter | `() => void` | `undefined` | 出现动画完成执行的回调 | 2.33.0 |
@ -108,15 +108,15 @@ rtl-debug.vue
| 名称 | 类型 | 说明 | 版本 |
| --- | --- | --- | --- |
| actionClass | `string` | 操作区域的类名 | NEXT_VERSION |
| actionStyle | `Object \| string` | 操作区域的样式 | NEXT_VERSION |
| actionClass | `string` | 操作区域的类名 | 2.38.2 |
| actionStyle | `Object \| string` | 操作区域的样式 | 2.38.2 |
| bordered | `boolean` | 是否显示 `border` | |
| class | `any` | 类名 | 2.33.0 |
| closable | `boolean` | 是否显示 `close` 图标 | |
| closeOnEsc | `boolean` | 是否在摁下 Esc 键的时候关闭对话框 | 2.26.4 |
| content | `string \| (() => VNodeChild)` | 对话框内容,可以是渲染函数 | |
| contentClass | `string` | 内容的类名 | NEXT_VERSION |
| contentStyle | `Object \| string` | 内容的样式 | NEXT_VERSION |
| contentClass | `string` | 内容的类名 | 2.38.2 |
| contentStyle | `Object \| string` | 内容的样式 | 2.38.2 |
| iconPlacement | `'left' \| 'top'` | 图标的位置 | |
| icon | `() => VNodeChild` | 对话框 `icon`,需要是渲染函数 | |
| loading | `boolean` | 是否显示 `loading` 状态 | |
@ -128,8 +128,8 @@ rtl-debug.vue
| showIcon | `boolean` | 是否显示 `icon` | |
| style | `string \| Object` | 样式 | |
| title | `string \| (() => VNodeChild)` | 可以是渲染函数 | |
| titleClass | `string` | 标题的类名 | NEXT_VERSION |
| titleStyle | `Object \| string` | 标题的样式 | NEXT_VERSION |
| titleClass | `string` | 标题的类名 | 2.38.2 |
| titleStyle | `Object \| string` | 标题的样式 | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | 对话框动画出现的位置 | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | 对话框类型 | |
| onAfterEnter | `() => void \| undefined` | 出现动画完成执行的回调 | 2.33.0 |
@ -149,13 +149,13 @@ rtl-debug.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| action-class | `string` | `undefined` | 操作区域的类名 | NEXT_VERSION |
| action-style | `Object \| string` | `undefined` | 操作区域的样式 | NEXT_VERSION |
| action-class | `string` | `undefined` | 操作区域的类名 | 2.38.2 |
| action-style | `Object \| string` | `undefined` | 操作区域的样式 | 2.38.2 |
| bordered | `boolean` | `false` | 是否显示 `border` | |
| closable | `boolean` | `true` | 是否显示 `close` 图标 | |
| content | `string \| (() => VNodeChild)` | `undefined` | 对话框内容,可以是渲染函数 | |
| content-class | `string` | `undefined` | 内容的类名 | NEXT_VERSION |
| content-style | `Object \| string` | `undefined` | 内容的样式 | NEXT_VERSION |
| content-class | `string` | `undefined` | 内容的类名 | 2.38.2 |
| content-style | `Object \| string` | `undefined` | 内容的样式 | 2.38.2 |
| icon-placement | `'left' \| 'top'` | `'left'` | 图标放置的位置 | |
| icon | `() => VNodeChild` | `undefined` | 需要是渲染函数 | |
| loading | `boolean` | `false` | 是否显示 `loading` 状态 | |
@ -165,8 +165,8 @@ rtl-debug.vue
| positive-text | `string` | `undefined` | 确认按钮的文字,不填对应的按钮不会出现 | |
| show-icon | `boolean` | `true` | 是否显示 `icon` | |
| title | `string \| (() => VNodeChild)` | `undefined` | 对话框标题,可以是渲染函数 | |
| title-class | `string` | `undefined` | 标题的类名 | NEXT_VERSION |
| title-style | `Object \| string` | `undefined` | 标题的样式 | NEXT_VERSION |
| title-class | `string` | `undefined` | 标题的类名 | 2.38.2 |
| title-style | `Object \| string` | `undefined` | 标题的样式 | 2.38.2 |
| type | `'error \| 'success' \| 'warning' \| 'info'` | `'warning'` | 对话框类型 | |
| on-close | `() => void` | `undefined` | 点击关闭时执行的回调函数 | |
| on-negative-click | `(e: MouseEvent) => void` | `undefined` | 执行 `negative` 时执行的回调函数 | |

View File

@ -33,7 +33,7 @@ feedback-style.vue
### Form Props
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- | --- |
| --- | --- | --- | --- | --- |
| disabled | `boolean` | `false` | Whether to disable the form. | |
| inline | `boolean` | `false` | Whether to display as an inline form. | |
| label-width | `number \| string \| 'auto'` | `undefined` | The width of label. Particularly useful when `label-placement` is set to `'left'`,`'auto'` means label width will be auto adjusted. | |
@ -42,8 +42,6 @@ feedback-style.vue
| model | `Object` | `{}` | The object to get/set form item values. | |
| rules | `type FormRules = { [itemValidatePath: string]: FormItemRule \| Array<FormItemRule> \| FormRules }` | `{}` | The rules to validate form items. | |
| show-feedback | `boolean` | `true` | Whether to show the feedback area. | |
| feedback-class | `string` | `undefined` | Feedback check vertical display positioning | NEXT_VERSION | |
| feedback-style | `string \| object` | `undefined` | Feedback check horizontal display positioning | NEXT_VERSION | |
| show-label | `boolean` | `true` | Whether to show the label. | |
| show-require-mark | `boolean` | `-` | Whether to show a required symbol when a form item is required. | |
| require-mark-placement | `'left' \| 'right' \| 'right-hanging'` | `'right'` | Require mark placement | `'right-hanging'` 2.24.0 |
@ -76,6 +74,8 @@ feedback-style.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| feedback | `string` | `undefined` | The feedback message of the form item. If set, it will replace any result of rule-based validation. | |
| feedback-class | `string` | `undefined` | Feedback check vertical display positioning | 2.38.2 |
| feedback-style | `string \| object` | `undefined` | Feedback check horizontal display positioning | 2.38.2 |
| first | `boolean` | `false` | Whether to only show the first validation error message. | |
| ignore-path-change | `boolean` | `false` | Usually, changing `path` will cause a re-render and naive-ui will clear the validation result. Setting `ignore-path-change` to `true` will disable that behavior. | |
| label | `string` | `undefined` | Label. | |

View File

@ -68,6 +68,8 @@ feedback-style.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| feedback | `string` | `undefined` | 表项的反馈信息。不设为 `undefined` 时,会覆盖规则验证的结果 | |
| feedback-class | `string` | `undefined` | 反馈校验竖向展示定位 | 2.38.2 |
| feedback-style | `string \| object` | `undefined` | 反馈校验横向展示定位 | 2.38.2 |
| first | `boolean` | `false` | 是否只展示首个出错信息 | |
| ignore-path-change | `boolean` | `false` | 通常 `path` 的改变会导致数据来源的变化,所以 naive-ui 会清空验证信息。如果不期望这个行为,可以将其置为 `true` | |
| label | `string` | `undefined` | 标签信息 | |
@ -80,8 +82,6 @@ feedback-style.vue
| rule | `FormItemRule \| Array<FormItemRule>` | `undefined` | 验证表项的规则,它会被通过 `rule-path` 从外层表单获取的规则合并来作为表项的验证规则。推荐还是在外层表单设置所有规则 | |
| rule-path | `string` | `undefined` | 从外层表单的 `rules` 对象获取规则的路径。如果没有设定,使用表项的 `path` 代替 | |
| show-feedback | `boolean` | `true` | 是否展示校验反馈 | |
| feedback-class | `string` | `undefined` | 反馈校验竖向展示定位 | NEXT_VERSION |
| feedback-style | `string \| object` | `undefined` | 反馈校验横向展示定位 | NEXT_VERSION |
| show-label | `boolean` | `true` | 是否展示标签。如果没有被设定,使用外层 `n-form``show-label` | |
| show-require-mark | `boolean` | `-` | 是否展示必填的星号。如果没有被设定,使用外层 `n-form``show-require-mark` | |
| require-mark-placement | `'left' \| 'right' \| 'right-hanging'` | `'right'` | 必填的星号的位置。如果没有被设定,使用外层 `n-form``require-mark-placement` | `'right-hanging'` 2.24.0 |

View File

@ -33,7 +33,7 @@ previewed-img-props.vue
| preview-src | `string` | `undefined` | Source of preview image. | |
| preview-disabled | `boolean` | `false` | Whether clicking image preview is disabled. | |
| previewed-img-props | `object` | `undefined` | DOM attributes of img element in preview mode. | 2.34.0 |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateLeft: VNode, rotateRight: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | Toolbar rendering function. | `NEXT_VERSION` |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateCounterclockwise: VNode, rotateClockwise: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | Toolbar rendering function. | `2.38.2` |
| show-toolbar | `boolean` | `true` | Whether to show the bottom toolbar when the image enlarge. | |
| show-toolbar-tooltip | `boolean` | `false` | Whether to show toolbar buttons' tooltip. | 2.24.0 |
| src | `string` | `undefined` | Image source. | |
@ -45,7 +45,7 @@ previewed-img-props.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateLeft: VNode, rotateRight: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | Toolbar rendering function. | `NEXT_VERSION` |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateCounterclockwise: VNode, rotateClockwise: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | Toolbar rendering function. | `2.38.2` |
| show-toolbar | `boolean` | `true` | Whether to show the bottom toolbar when the image enlarge. | |
| show-toolbar-tooltip | `boolean` | `false` | Whether to show toolbar buttons' tooltip. | 2.24.0 |
| on-preview-prev | `() => void` | `undefined` | Click the callback from the previous slide | |

View File

@ -33,7 +33,7 @@ previewed-img-props.vue
| preview-src | `string` | `undefined` | 预览图片的图片地址 | |
| preview-disabled | `boolean` | `false` | 是否禁用单击图像预览 | |
| previewed-img-props | `object` | `undefined` | 预览图片时 img 元素的属性 | 2.34.0 |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateLeft: VNode, rotateRight: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | 工具栏的渲染函数 | `NEXT_VERSION` |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateCounterclockwise: VNode, rotateClockwise: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | 工具栏的渲染函数 | `2.38.2` |
| show-toolbar | `boolean` | `true` | 图片放大后是否展示底部工具栏 | |
| show-toolbar-tooltip | `boolean` | `false` | 是否展示工具栏的提示 | 2.24.0 |
| src | `string` | `undefined` | 图片来源 | |
@ -45,7 +45,7 @@ previewed-img-props.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateLeft: VNode, rotateRight: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | 工具栏的渲染函数 | `NEXT_VERSION` |
| render-toolbar | `(props: { nodes: { prev: VNode, next: VNode, rotateCounterclockwise: VNode, rotateClockwise: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild` | `undefined` | 工具栏的渲染函数 | `2.38.2` |
| show-toolbar | `boolean` | `true` | 图片放大后是否展示底部工具栏 | |
| show-toolbar-tooltip | `boolean` | `false` | 是否展示工具栏的提示 | 2.24.0 |
| on-preview-prev | `() => void` | `undefined` | 点击上一张的回调 | |

View File

@ -146,14 +146,10 @@ export default defineComponent({
} = opts
const deltaHorizontal = mouseDownClientX - mouseUpClientX
const deltaVertical = mouseDownClientY - mouseUpClientY
const moveVerticalDirection:
| 'verticalTop'
| 'verticalBottom' = `vertical${deltaVertical > 0 ? 'Top' : 'Bottom'}`
const moveHorizontalDirection:
| 'horizontalLeft'
| 'horizontalRight' = `horizontal${
deltaHorizontal > 0 ? 'Left' : 'Right'
}`
const moveVerticalDirection: 'verticalTop' | 'verticalBottom' =
`vertical${deltaVertical > 0 ? 'Top' : 'Bottom'}`
const moveHorizontalDirection: 'horizontalLeft' | 'horizontalRight' =
`horizontal${deltaHorizontal > 0 ? 'Left' : 'Right'}`
return {
moveVerticalDirection,
@ -505,7 +501,7 @@ export default defineComponent({
'tipNext'
)
const rotateLeftNode = withTooltip(
const rotateCounterclockwiseNode = withTooltip(
<NBaseIcon clsPrefix={clsPrefix} onClick={this.rotateCounterclockwise}>
{{
default: () => <RotateCounterclockwiseIcon />
@ -513,7 +509,7 @@ export default defineComponent({
</NBaseIcon>,
'tipCounterclockwise'
)
const rotateRightNode = withTooltip(
const rotateClockwiseNode = withTooltip(
<NBaseIcon clsPrefix={clsPrefix} onClick={this.rotateClockwise}>
{{
default: () => <RotateClockwiseIcon />
@ -601,8 +597,9 @@ export default defineComponent({
nodes: {
prev: prevNode,
next: nextNode,
rotateLeft: rotateLeftNode,
rotateRight: rotateRightNode,
rotateCounterclockwise:
rotateCounterclockwiseNode,
rotateClockwise: rotateClockwiseNode,
resizeToOriginalSize: originalSizeNode,
zoomOut: zoomOutNode,
zoomIn: zoomInNode,
@ -618,8 +615,8 @@ export default defineComponent({
{nextNode}
</>
) : null}
{rotateLeftNode}
{rotateRightNode}
{rotateCounterclockwiseNode}
{rotateClockwiseNode}
{originalSizeNode}
{zoomOutNode}
{zoomInNode}

View File

@ -4,8 +4,8 @@ export interface ImageRenderToolbarProps {
nodes: {
prev: VNode
next: VNode
rotateLeft: VNode
rotateRight: VNode
rotateCounterclockwise: VNode
rotateClockwise: VNode
resizeToOriginalSize: VNode
zoomOut: VNode
zoomIn: VNode

View File

@ -1,5 +1,5 @@
<markdown>
# Basic
# Basic
</markdown>
<template>
@ -12,6 +12,7 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const count = ref(6)
@ -25,6 +26,7 @@ export default defineComponent({
}
})
</script>
<style>
.item {
display: flex;
@ -34,4 +36,8 @@ export default defineComponent({
margin-bottom: 10px;
background-color: #e7f5ee;
}
.item:last-child {
margin-bottom: 0;
}
</style>

View File

@ -1,5 +1,5 @@
<markdown>
# Demo
# A bit complex example
</markdown>
<template>
@ -7,7 +7,7 @@
<div
v-for="(item, index) in items"
:key="item.key"
class="item"
class="message"
:class="{ reverse: index % 5 === 0 }"
>
<img class="avatar" :src="item.avatar" alt="">
@ -24,6 +24,7 @@
<script lang="ts">
import { computed, defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const loading = ref(false)
@ -67,22 +68,31 @@ export default defineComponent({
}
})
</script>
<style>
.item {
.message {
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 10px;
}
.message:last-child {
margin-bottom: 0;
}
.reverse {
flex-direction: row-reverse;
}
.text {
text-align: center;
}
.reverse .avatar {
margin-left: 10px;
}
.avatar {
width: 28px;
height: 28px;

View File

@ -1,42 +0,0 @@
<markdown>
# Delay
</markdown>
<template>
<n-infinite-scroll
style="height: 240px"
:distance="10"
:delay="1000"
@load="handleLoad"
>
<div v-for="i in count" :key="i" class="item">
{{ i }}
</div>
</n-infinite-scroll>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const count = ref(6)
const handleLoad = () => {
count.value += 1
}
return {
count,
handleLoad
}
}
})
</script>
<style>
.item {
display: flex;
align-items: center;
height: 46px;
justify-content: center;
margin-bottom: 10px;
background-color: #e7f5ee;
}
</style>

View File

@ -1,14 +1,13 @@
# Infinite Scroll
Snowball, roll and roll, more and more content, can not stop.
Scroll, scroll, scroll, scroll...
Available since `NEXT_VERSION`.
Available since `2.38.2`.
## Demos
```demo
basic.vue
delay.vue
chat.vue
```
@ -18,7 +17,6 @@ chat.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| delay | `Number` | `undefined` | Delay display, in milliseconds. | NEXT_VERSION |
| distance | `Number` | `0` | Distance threshold that triggers loading. | NEXT_VERSION |
| on-load | `() => Promise<void>` | `undefined` | The callback function when scrolling to the bottom. | NEXT_VERSION |
| scrollbar-props | `Object` | `undefined` | Attribute reference [Scrollbar props](scrollbar#Scrollbar-Props). | NEXT_VERSION |
| distance | `number` | `0` | Distance threshold that triggers loading. | 2.38.2 |
| scrollbar-props | `Object` | `undefined` | Attribute reference [Scrollbar props](scrollbar#Scrollbar-Props). | 2.38.2 |
| on-load | `() => Promise<void> \| void` | `undefined` | The callback function when scrolling to the bottom. | 2.38.2 |

View File

@ -1,5 +1,5 @@
<markdown>
# 基础
# 基础
</markdown>
<template>
@ -12,6 +12,7 @@
<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const count = ref(6)
@ -25,6 +26,7 @@ export default defineComponent({
}
})
</script>
<style>
.item {
display: flex;
@ -34,4 +36,8 @@ export default defineComponent({
margin-bottom: 10px;
background-color: #e7f5ee;
}
.item:last-child {
margin-bottom: 0;
}
</style>

View File

@ -1,5 +1,5 @@
<markdown>
# 示例
# 稍微复杂的例子
</markdown>
<template>
@ -7,7 +7,7 @@
<div
v-for="(item, index) in items"
:key="item.key"
class="item"
class="message"
:class="{ reverse: index % 5 === 0 }"
>
<img class="avatar" :src="item.avatar" alt="">
@ -24,6 +24,7 @@
<script lang="ts">
import { computed, defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const loading = ref(false)
@ -67,22 +68,31 @@ export default defineComponent({
}
})
</script>
<style>
.item {
.message {
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 10px;
}
.message:last-child {
margin-bottom: 0;
}
.reverse {
flex-direction: row-reverse;
}
.text {
text-align: center;
}
.reverse .avatar {
margin-left: 10px;
}
.avatar {
width: 28px;
height: 28px;

View File

@ -1,42 +0,0 @@
<markdown>
# 延时
</markdown>
<template>
<n-infinite-scroll
style="height: 240px"
:distance="10"
:delay="1000"
@load="handleLoad"
>
<div v-for="i in count" :key="i" class="item">
{{ i }}
</div>
</n-infinite-scroll>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
setup () {
const count = ref(6)
const handleLoad = () => {
count.value += 1
}
return {
count,
handleLoad
}
}
})
</script>
<style>
.item {
display: flex;
align-items: center;
height: 46px;
justify-content: center;
margin-bottom: 10px;
background-color: #e7f5ee;
}
</style>

View File

@ -1,14 +1,13 @@
# 无限滚动
滚雪球,滚啊滚,内容越来越多,停不下来
滚雪球,滚啊滚,内容越来越多,停不下来
`NEXT_VERSION` 版本开始提供该组件。
`2.38.2` 版本开始提供该组件。
## 演示
```demo
basic.vue
delay.vue
chat.vue
```
@ -18,7 +17,6 @@ chat.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| delay | `Number` | `undefined` | 延迟显示,单位为毫秒 | NEXT_VERSION |
| distance | `Number` | `0` | 触发加载的距离阈值 | NEXT_VERSION |
| on-load | `() => Promise<void>` | `undefined` | 滚动到底部时的回调函数 | NEXT_VERSION |
| scrollbar-props | `Object` | `undefined` | 属性参考 [Scrollbar props](scrollbar#Scrollbar-Props) | NEXT_VERSION |
| distance | `number` | `0` | 触发加载的距离阈值 | 2.38.2 |
| scrollbar-props | `Object` | `undefined` | 属性参考 [Scrollbar props](scrollbar#Scrollbar-Props) | 2.38.2 |
| on-load | `() => Promise<void> \| void` | `undefined` | 滚动到底部时的回调函数 | 2.38.2 |

View File

@ -1,19 +1,15 @@
import { h, defineComponent, type PropType, ref } from 'vue'
import type { ExtractPublicPropTypes } from '../../_utils'
import { resolveSlot } from '../../_utils'
import { type ScrollbarProps } from '../../scrollbar/src/Scrollbar'
import { NxScrollbar, type ScrollbarInst } from '../../_internal'
import { debounce } from 'lodash-es'
export const infiniteScrollProps = {
distance: {
type: Number,
default: 0
},
delay: {
type: Number,
default: undefined
},
onLoad: Function as PropType<() => Promise<void>>,
onLoad: Function as PropType<() => Promise<void> | void>,
scrollbarProps: Object as PropType<ScrollbarProps>
} as const
@ -27,6 +23,8 @@ export default defineComponent({
setup (props) {
const scrollbarInstRef = ref<ScrollbarInst | null>(null)
let loading = false
const handleCheckBottom = async (): Promise<void> => {
const { value: scrollbarInst } = scrollbarInstRef
if (scrollbarInst) {
@ -42,24 +40,31 @@ export default defineComponent({
containerScrollTop + clientHeight >=
scrollHeight - props.distance
) {
await props.onLoad?.()
loading = true
try {
await props.onLoad?.()
} catch {}
loading = false
}
}
}
}
const handleScroll = (): void => {
if (props.delay) {
const debounceFn = debounce(handleCheckBottom, props.delay)
debounceFn() as any
} else {
handleCheckBottom() as any
}
if (loading) return
void handleCheckBottom()
}
const handleWheel = (e: WheelEvent): void => {
if (e.deltaY <= 0) return
if (loading) return
void handleCheckBottom()
}
return {
scrollbarInstRef,
handleScroll
handleScroll,
handleWheel
}
},
render () {
@ -67,15 +72,12 @@ export default defineComponent({
<NxScrollbar
{...this.scrollbarProps}
ref="scrollbarInstRef"
onWheel={this.handleWheel}
onScroll={this.handleScroll}
>
{{
default: () => {
return (
<div style={{ height: '100%', overflow: 'auto' }}>
{this.$slots.default?.()}
</div>
)
return resolveSlot(this.$slots.default, () => [])
}
}}
</NxScrollbar>

View File

@ -31,7 +31,7 @@ Mention requires `v2.2.0` and above.
| bordered | `boolean` | `true` | Whether to display the border of the input element. | |
| disabled | `boolean` | `false` | Whether to disable the input element. | |
| default-value | `string` | `''` | Default value when the value is not manually set. | |
| filter | `(pattern: string, option: MentionOption) => boolean` | Default filter method | Method to filter options corresponding to `pattern`. | NEXT_VERSION |
| filter | `(pattern: string, option: MentionOption) => boolean` | Default filter method | Method to filter options corresponding to `pattern`. | 2.38.2 |
| loading | `boolean` | `false` | Whether the selection panel of mentions is in a loading state. | |
| prefix | `string \| string[]` | `'@'` | Prefix character(s) to trigger mentions. The string length(s) must be exactly 1. | |
| placeholder | `string` | `''` | Placeholder. | |

View File

@ -31,7 +31,7 @@ Mention 在 `v2.2.0` 及以后可用。
| bordered | `boolean` | `true` | 是否显示输入框边框 | |
| disabled | `boolean` | `false` | 是否设置输入框为禁用状态 | |
| default-value | `string` | `''` | 输入框的默认值 | |
| filter | `(pattern: string, option: MentionOption) => boolean` | 内置的过滤函数 | 根据 `pattern` 决定显示那些选项的过滤函数 | NEXT_VERSION |
| filter | `(pattern: string, option: MentionOption) => boolean` | 内置的过滤函数 | 根据 `pattern` 决定显示那些选项的过滤函数 | 2.38.2 |
| loading | `boolean` | `false` | 选择面板是否显示加载状态 | |
| prefix | `string \| string[]` | `'@'` | 触发提及的前缀,长度必须为 1 | |
| placeholder | `string` | `''` | 输入框的占位符 | |

View File

@ -32,7 +32,7 @@ type.vue
| padding | `number \| string` | `12` | Padding size of the QR Code. | 2.36.0 |
| value | `string` | `''` | Text information. | 2.36.0 |
| size | `number` | `100` | Size of the qrcode. | 2.36.0 |
| type | `'canvas'` \| `'svg'` | `'canvas'` | Customize Render Type. | NEXT_VERSION |
| type | `'canvas'` \| `'svg'` | `'canvas'` | Customize Render Type. | 2.38.2 |
### About QR code error correction level

View File

@ -32,7 +32,7 @@ type.vue
| padding | `number \| string` | `12` | 二维码填充大小 | 2.36.0 |
| value | `string` | `''` | 文本信息 | 2.36.0 |
| size | `number` | `100` | 二维码大小 | 2.36.0 |
| type | `'canvas'` \| `'svg'` | `'canvas'` | 自定义二维码渲染类型 | NEXT_VERSION |
| type | `'canvas'` \| `'svg'` | `'canvas'` | 自定义二维码渲染类型 | 2.38.2 |
### 关于二维码纠错级别

View File

@ -18,8 +18,8 @@ custom.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| content-class | `string` | `undefined` | Class name of content div. | NEXT_VERSION |
| content-style | `string \| object` | `undefined` | Style of content div. | NEXT_VERSION |
| content-class | `string` | `undefined` | Class name of content div. | 2.38.2 |
| content-style | `string \| object` | `undefined` | Style of content div. | 2.38.2 |
| size | `number` | `undefined` | Size of scrollbar. | 2.34.4 |
| trigger | `'hover' \| 'none'` | `'hover'` | Trigger of show scrollbar. `'none'` means always show it. | 2.29.1 |
| x-scrollable | `boolean` | `false` | Whether it can scroll horizontally. | |

View File

@ -19,8 +19,8 @@ custom.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| content-class | `string` | `undefined` | 内容 div 的类名 | NEXT_VERSION |
| content-style | `string \| object` | `undefined` | 内容 div 的 style | NEXT_VERSION |
| content-class | `string` | `undefined` | 内容 div 的类名 | 2.38.2 |
| content-style | `string \| object` | `undefined` | 内容 div 的 style | 2.38.2 |
| size | `number` | `undefined` | 滚动条的大小 | 2.34.4 |
| trigger | `'hover' \| 'none'` | `'hover'` | 显示滚动条的时机,`'none'` 表示一直显示 | 2.29.1 |
| x-scrollable | `boolean` | `false` | 是否可以横向滚动 | |

View File

@ -21,19 +21,19 @@ controlled.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| default-size | `number` | `0.5` | Default split size, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` NEXT_VERSION |
| default-size | `number` | `0.5` | Default split size, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` 2.38.2 |
| direction | `'horizontal' \| 'vertical'` | `'horizontal'` | The direction of the split. | 2.36.0 |
| disabled | `boolean` | `false` | Whether to disable the split. | 2.36.0 |
| max | `string \| number` | `1` | The maximum split threshold, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` NEXT_VERSION |
| min | `string \| number` | `0` | The minimum threshold for splitting, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` NEXT_VERSION |
| pane1-class | `string` | `undefined` | The class name of the first pane. | NEXT_VERSION |
| pane1-style | `Object \| string` | `undefined` | The Style of the first pane | NEXT_VERSION |
| pane2-class | `string` | `undefined` | The class name of the second pane. | NEXT_VERSION |
| pane2-style | `Object \| string` | `undefined` | The Style of the second pane | NEXT_VERSION |
| max | `string \| number` | `1` | The maximum split threshold, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` 2.38.2 |
| min | `string \| number` | `0` | The minimum threshold for splitting, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.36.0, `string` 2.38.2 |
| pane1-class | `string` | `undefined` | The class name of the first pane. | 2.38.2 |
| pane1-style | `Object \| string` | `undefined` | The Style of the first pane | 2.38.2 |
| pane2-class | `string` | `undefined` | The class name of the second pane. | 2.38.2 |
| pane2-style | `Object \| string` | `undefined` | The Style of the second pane | 2.38.2 |
| resize-trigger-size | `number` | `3` | Size of the resize trigger. | 2.36.0 |
| size | `string \| number` | `undefined` | Split is the controlled split size, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.38.0, `string` NEXT_VERSION |
| size | `string \| number` | `undefined` | Split is the controlled split size, when it's `number` it should in 0 ~ 1, when it's `string` it should be formatted in `${number}px`. | 2.38.0, `string` 2.38.2 |
| watch-props | `Array<'defaultSize'>` | `undefined` | Default prop names that needed to be watched. Components will be updated after the prop is changed. Note: the `watch-props` itself is not reactive. | 2.38.0 |
| on-update:size | `(value: string \| number) => void` | `undefined` | Callback fired on `size` changes. If `props.value` or `props.defaultValue` is `string`, `value` is `string`. | 2.38.0, `string` NEXT_VERSION |
| on-update:size | `(value: string \| number) => void` | `undefined` | Callback fired on `size` changes. If `props.value` or `props.defaultValue` is `string`, `value` is `string`. | 2.38.0, `string` 2.38.2 |
### Split Slots

View File

@ -22,17 +22,17 @@ pixel-value.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| default-size | `string \| number` | `0.5` | Split 的默认分割大小,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` NEXT_VERSION |
| default-size | `string \| number` | `0.5` | Split 的默认分割大小,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` 2.38.2 |
| direction | `'horizontal' \| 'vertical'` | `'horizontal'` | Split 的分割方向 | 2.36.0 |
| disabled | `boolean` | `false` | 是否禁用 | 2.36.0 |
| max | `string \| number` | `1` | Split 的分割最大阈值,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` NEXT_VERSION |
| min | `string \| number` | `0` | Split 的分割最小阈值,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` NEXT_VERSION |
| pane1-class | `string` | `undefined` | 第一个面板的类名 | NEXT_VERSION |
| pane1-style | `Object \| string` | `undefined` | 第一个面板的样式 | NEXT_VERSION |
| pane2-class | `string` | `undefined` | 第二个面板的类名 | NEXT_VERSION |
| pane2-style | `Object \| string` | `undefined` | 第二个面板的样式 | NEXT_VERSION |
| max | `string \| number` | `1` | Split 的分割最大阈值,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` 2.38.2 |
| min | `string \| number` | `0` | Split 的分割最小阈值,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.36.0, `string` 2.38.2 |
| pane1-class | `string` | `undefined` | 第一个面板的类名 | 2.38.2 |
| pane1-style | `Object \| string` | `undefined` | 第一个面板的样式 | 2.38.2 |
| pane2-class | `string` | `undefined` | 第二个面板的类名 | 2.38.2 |
| pane2-style | `Object \| string` | `undefined` | 第二个面板的样式 | 2.38.2 |
| resize-trigger-size | `number` | `3` | Split 的分隔条大小 | 2.36.0 |
| size | `string \| number` | `undefined` | Split 的受控分割大小,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.38.0, `string` NEXT_VERSION |
| size | `string \| number` | `undefined` | Split 的受控分割大小,为 `number` 类型时应该为 0 ~ 1 之间的值,为 `string` 类型时应该为 `${number}px` 格式 | 2.38.0, `string` 2.38.2 |
| watch-props | `Array<'defaultSize'>` | `undefined` | 需要检测变更的默认属性,检测后组件状态会更新。注意:`watch-props` 本身不是响应式的 | 2.38.0 |
| on-update:size | `(value: string \| number) => void` | `undefined` | 组件 `size` 属性变化时触发的回调,如果 `props.value``props.defaultValue``string``value``string` | 2.38.0 |

View File

@ -1,7 +1,7 @@
<markdown>
# 使用像素值控制尺寸
`NEXT_VERSION` 开始`min``max``size` `default-size` 属性可以接受像素值
`2.38.2` 开始`min``max``size` `default-size` 属性可以接受像素值
</markdown>
<template>

View File

@ -433,9 +433,7 @@ export default defineComponent({
segmentCapsuleElRef.value.style.width = `${activeTabEl.offsetWidth}px`
segmentCapsuleElRef.value.style.height = `${activeTabEl.offsetHeight}px`
segmentCapsuleElRef.value.style.transform = `translateX(${
activeTabEl.offsetLeft -
tabsEl.offsetLeft -
depx(getComputedStyle(tabsEl).paddingLeft)
activeTabEl.offsetLeft - depx(getComputedStyle(tabsEl).paddingLeft)
}px)`
if (transitionDisabled) {
void segmentCapsuleElRef.value.offsetWidth

View File

@ -67,7 +67,7 @@ download.vue
| on-before-upload | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo> }) => (Promise<boolean \| void> \| boolean \| void)` | `true` | Upload ready to start callback. Returning `false`, a promise resolved with `false`, or a rejected promise will cancel the upload. | |
| on-download | `(file: FileInfo) => void` | `undefined` | Callback for clicking download buttons. Returning `false`, `Promise resolve false`, `Promise rejected` will cancel the download. | |
| on-preview | `(file: FileInfo) => void` | `undefined` | Callback for clicking file links or preview buttons. | |
| on-remove | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, index: number }) => Promise<boolean> \| boolean \| any` | `() => true` | File removed callback. Returning `false`, a promise resolved with `false`, or a rejected promise will cancel this removal. | `index` NEXT_VERSION |
| on-remove | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, index: number }) => Promise<boolean> \| boolean \| any` | `() => true` | File removed callback. Returning `false`, a promise resolved with `false`, or a rejected promise will cancel this removal. | `index` 2.38.2 |
| on-update:file-list | `(fileList: UploadFileInfo[]) => void` | `undefined` | Callback function triggered on file-list changes. | |
#### UploadFileInfo Type

View File

@ -68,7 +68,7 @@ debug.vue
| on-before-upload | `(options: { file: UploadFileInfo, fileList: UploadFileInfo[] }) => (Promise<boolean \| void> \| boolean \| void)` | `undefined` | 文件上传之前的回调,返回 `false`、`Promise resolve false`、`Promise rejected` 时会取消本次上传 | |
| on-download | `(file: FileInfo) => void` | `undefined` | 点击文件下载按钮的回调函数,返回 `false`、`Promise resolve false`、`Promise rejected` 时会取消本次下载 | |
| on-preview | `(file: FileInfo) => void` | `undefined` | 点击文件链接或预览按钮的回调函数 | |
| on-remove | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, index: number }) => Promise<boolean> \| boolean \| any` | `() => true` | 文件删除回调,返回 `false`、`Promise resolve false`、`Promise rejected` 时会取消本次删除 | `index` NEXT_VERSION |
| on-remove | `(options: { file: UploadFileInfo, fileList: Array<UploadFileInfo>, index: number }) => Promise<boolean> \| boolean \| any` | `() => true` | 文件删除回调,返回 `false`、`Promise resolve false`、`Promise rejected` 时会取消本次删除 | `index` 2.38.2 |
| on-update:file-list | `(fileList: UploadFileInfo[]) => void` | `undefined` | 当 file-list 改变时触发的回调函数 | |
#### UploadFileInfo Type

View File

@ -1 +1 @@
export default '2.38.1'
export default '2.38.2'

View File

@ -12,7 +12,7 @@ image.vue
## API
Supports multiple lines text separated by `\n` since `NEXT_VERSION`.
Supports multiple lines text separated by `\n` since `2.38.2`.
### Watermark Props
@ -37,7 +37,7 @@ Supports multiple lines text separated by `\n` since `NEXT_VERSION`.
| image-width | `number` | `undefined` | Image width. | 2.25.3 |
| rotate | `number` | `0` | Rotate degree | 2.25.3 |
| selectable | `boolean` | `true` | Whether content covered by watermark is selectable. | 2.25.3 |
| text-align | `'left' \| 'center' \| 'right'` | `'left'` | Text align method when there's multiple lines of text. | NEXT_VERSION |
| text-align | `'left' \| 'center' \| 'right'` | `'left'` | Text align method when there's multiple lines of text. | 2.38.2 |
| width | `number` | `32` | Width of watermark area. | 2.25.3 |
| x-gap | `number` | `0` | Horizontal gap. | 2.25.3 |
| x-offset | `number` | `0` | Horizontal offset. | 2.25.3 |

View File

@ -12,7 +12,7 @@ image.vue
## API
`NEXT_VERSION` 支持由 `\n` 分割的多行文本。
`2.38.2` 支持由 `\n` 分割的多行文本。
### Watermark Props
@ -37,7 +37,7 @@ image.vue
| image-width | `number` | `undefined` | 图片宽度 | 2.25.3 |
| rotate | `number` | `0` | 旋转角度 | 2.25.3 |
| selectable | `boolean` | `true` | 被水印覆盖的内容是否可选中 | 2.25.3 |
| text-align | `'left' \| 'center' \| 'right'` | `'left'` | 在文本有多行的情况下,多行文本的对齐方式 | NEXT_VERSION |
| text-align | `'left' \| 'center' \| 'right'` | `'left'` | 在文本有多行的情况下,多行文本的对齐方式 | 2.38.2 |
| width | `number` | `32` | 宽度 | 2.25.3 |
| x-gap | `number` | `0` | x 轴间隔 | 2.25.3 |
| x-offset | `number` | `0` | x 轴偏移 | 2.25.3 |