Skip to content

Commit

Permalink
feat(comp:card): shadow supports global config now
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Sep 19, 2023
1 parent 51ae0b2 commit 7da0ea7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
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

0 comments on commit 7da0ea7

Please sign in to comment.