From 49bc1e5910fc99628c96bf140fcf1012cd82f166 Mon Sep 17 00:00:00 2001 From: zhanglecong <07akioni2@gmail.com> Date: Thu, 21 Dec 2023 20:23:34 +0800 Subject: [PATCH] refactor(avatar-group): expand on hover --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 2 +- src/avatar-group/src/AvatarGroup.tsx | 3 ++- src/avatar/demos/enUS/index.demo-entry.md | 14 +++++++------- src/avatar/demos/zhCN/index.demo-entry.md | 14 +++++++------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 9be5feda6..99950312c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -44,7 +44,7 @@ - `n-select` adds `ellipsis-tag-popover-props` prop. - `n-tree-select` adds `ellipsis-tag-popover-props` prop. - `n-date-picker` adds `month-string-type` prop, closes [#4891](https://github.com/tusen-ai/naive-ui/issues/4891) -- `n-avatar-group` adds `hover-expand` prop. +- `n-avatar-group` adds `expand-on-hover` prop. ## 2.36.0 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index ddefc3140..d3acfbc94 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -45,7 +45,7 @@ - `n-select` 新增 `ellipsis-tag-popover-props` 属性 - `n-tree-select` 新增 `ellipsis-tag-popover-props` 属性 - `n-date-picker` 新增 `month-string-type` 属性,关闭 [#4891](https://github.com/tusen-ai/naive-ui/issues/4891) -- `n-avatar-group` 新增 `hover-expand` 属性 +- `n-avatar-group` 新增 `expand-on-hover` 属性 - TODO: tree select 支持控制节点展开行为 ## 2.36.0 diff --git a/src/avatar-group/src/AvatarGroup.tsx b/src/avatar-group/src/AvatarGroup.tsx index f6f36a45c..d278d56a6 100644 --- a/src/avatar-group/src/AvatarGroup.tsx +++ b/src/avatar-group/src/AvatarGroup.tsx @@ -100,7 +100,8 @@ export default defineComponent({ `${mergedClsPrefix}-avatar-group`, this.rtlEnabled && `${mergedClsPrefix}-avatar-group--rtl`, this.vertical && `${mergedClsPrefix}-avatar-group--vertical`, - this. expandOnHover && `${mergedClsPrefix}-avatar-group--expand-on-hover` + this.expandOnHover && + `${mergedClsPrefix}-avatar-group--expand-on-hover` ]} style={this.cssVars} role="group" diff --git a/src/avatar/demos/enUS/index.demo-entry.md b/src/avatar/demos/enUS/index.demo-entry.md index 9c98e6a76..e8c245e23 100644 --- a/src/avatar/demos/enUS/index.demo-entry.md +++ b/src/avatar/demos/enUS/index.demo-entry.md @@ -39,13 +39,13 @@ v-show-debug.vue ### AvatarGroup Props -| Name | Type | Default | Description | -| --- | --- | --- | --- | -| expand-on-hover| `boolean` | `false` | Expand on hover. | -| max | `number` | `undefined` | Max avatar count in the group. | -| max-style | `Object \| string` | `undefined` | The style of the overflow placeholder. | -| options | `Array` | `[]` | Avatar group options. | -| vertical | `boolean` | `false` | Whether display a vertical avatar group. | +| Name | Type | Default | Description | Version | +| --- | --- | --- | --- | --- | +| expand-on-hover | `boolean` | `false` | Expand on hover. | NEXT_VERSION | +| max | `number` | `undefined` | Max avatar count in the group. | | +| max-style | `Object \| string` | `undefined` | The style of the overflow placeholder. | | +| options | `Array` | `[]` | Avatar group options. | | +| vertical | `boolean` | `false` | Whether display a vertical avatar group. | | see [Avatar Props](#Avatar-Props) diff --git a/src/avatar/demos/zhCN/index.demo-entry.md b/src/avatar/demos/zhCN/index.demo-entry.md index 0ad3043b1..e965bc4fb 100644 --- a/src/avatar/demos/zhCN/index.demo-entry.md +++ b/src/avatar/demos/zhCN/index.demo-entry.md @@ -41,13 +41,13 @@ rtl-debug.vue ### AvatarGroup Props -| 名称 | 类型 | 默认值 | 说明 | -| ------------ | --------------------- | ----------- | ---------------------- | -| expand-on-hover | `boolean` | `false` | 悬停时展开 | -| max | `number` | `undefined` | 组内头像显示的最大个数 | -| max-style | `Object \| string` | `undefined` | 溢出标识的样式 | -| options | `Array` | `[]` | 头像组的选项 | -| vertical | `boolean` | `false` | 组内头像是否垂直排列 | +| 名称 | 类型 | 默认值 | 说明 | 版本 | +| --- | --- | --- | --- | --- | +| expand-on-hover | `boolean` | `false` | 悬停时展开 | NEXT_VERSION | +| max | `number` | `undefined` | 组内头像显示的最大个数 | | +| max-style | `Object \| string` | `undefined` | 溢出标识的样式 | | +| options | `Array` | `[]` | 头像组的选项 | | +| vertical | `boolean` | `false` | 组内头像是否垂直排列 | | 参考 [Avatar Props](avatar#Props)