refactor(card): tag prop

This commit is contained in:
07akioni 2022-12-11 21:47:58 +08:00
parent 11d5acc76b
commit 0d343d5707
4 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,10 @@
## NEXT_VERSION
### Feats
- `n-card` 新增 `tag` 属性
### Fixes
- 修复 `n-image` 的预览工具栏报错,关闭 [#4157](https://github.com/tusen-ai/naive-ui/issues/4157)

View File

@ -35,7 +35,7 @@ embedded.vue
| hoverable | `boolean` | `false` | Whether to show shadow when hovering on the card. | |
| 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` | `'button'` | What tag need the card be rendered as. | |
| tag | `string` | `'div'` | What tag need the card be rendered as. | NEXT_VERSION |
| title | `string` | `undefined` | Card title. | |
| on-close | `() => void` | `undefined` | Callback function triggered upon closing the card. | |

View File

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

View File

@ -35,10 +35,7 @@ export const cardBaseProps = {
type: Boolean,
default: true as boolean
},
closable: {
type: Boolean,
default: false as boolean
},
closable: Boolean,
hoverable: Boolean,
role: String,
onClose: [Function, Array] as PropType<MaybeArray<() => void>>,