Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(comp:card): shadow supports global config now #1696

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/card/docs/Api.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| `cover` | 卡片封面图片 | `string \| CardCover \| #cover` | - | - | - |
| `header` | 对话框标题 | `string \| HeaderProps \| #header` | - | - | - |
| `hoverable` | 鼠标 hover 时,是否悬浮 | `boolean` | `false` | ✅ | - |
| `shadow` | 是否有阴影 | `boolean` | `true` | - | - |
| `shadow` | 是否有阴影 | `boolean` | `true` | | - |
| `loading` | 是否加载中状态 | `boolean` | `false` | - | 当卡片内容还在加载中时,显示占位图 |
| `size` | 设置卡片大小 | `'sm' \| 'md' \| 'lg'` | `'md'` | ✅ | - |
| `footer` | 自定义底部按钮 | `CardButtonProps[] \| #footer` | - | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/card/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineComponent({

return () => {
const prefixCls = mergedPrefixCls.value
const { borderless = config.borderless, loading, size = config.size, shadow } = props
const { borderless = config.borderless, loading, size = config.size, shadow = config.shadow } = props

const children = slots.default?.() ?? []
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion packages/components/card/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const cardProps = {
},
shadow: {
type: Boolean,
default: true,
default: undefined,
},
loading: {
type: Boolean,
Expand Down
1 change: 1 addition & 0 deletions packages/components/config/src/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const defaultConfig: GlobalConfig = {
borderless: false,
hoverable: false,
size: 'md',
shadow: true,
},
carousel: {
autoplayTime: 0,
Expand Down
1 change: 1 addition & 0 deletions packages/components/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export interface CardConfig {
size: CardSize
borderless: boolean
hoverable: boolean
shadow: boolean
}

export interface CarouselConfig {
Expand Down