diff --git a/packages/varlet-ui/src/card/Card.vue b/packages/varlet-ui/src/card/Card.vue index ccfbc53e600..dbd5f22be0a 100644 --- a/packages/varlet-ui/src/card/Card.vue +++ b/packages/varlet-ui/src/card/Card.vue @@ -1,7 +1,15 @@ ``` +### Filled + +```html + +``` + ## API ### Props @@ -161,6 +174,7 @@ const floating = ref(false) | `src` | The src of Image | _string_ | `-` | | `layout` | Arrangement mode, options `row` `column` | _string_ | `column` | | `fit` | Fill mode, options `fill` `contain` `cover` `none` `scale-down` | _string_ | `cover` | +| `filled` | Whether to be filled card | _boolean_ | `false` | | `outline` | Whether to be outline card | _boolean_ | `false` | | `alt` | Image alt text, the same as the native attribute of the `img` tag | _string_ | `-` | | `image-height` | Height of Image | _string \| number_ | `-` | @@ -195,6 +209,7 @@ Here are the CSS variables used by the component. Styles can be customized using | Variable | Default | |-------------------------------------|-----------------------| | `--card-background` | `var(--color-surface-container-highest)` | +| `--card-filled-background` | `hsla(0, 0%, 93%, 1)` | | `--card-padding` | `0px 0 15px 0` | | `--card-border-radius` | `4px` | | `--card-outline-color` | `var(--color-outline)` | diff --git a/packages/varlet-ui/src/card/docs/zh-CN.md b/packages/varlet-ui/src/card/docs/zh-CN.md index 32034416bc4..d914209d5d7 100644 --- a/packages/varlet-ui/src/card/docs/zh-CN.md +++ b/packages/varlet-ui/src/card/docs/zh-CN.md @@ -148,6 +148,20 @@ const floating = ref(false) ``` + +### 填充 + +```html + +``` + ## API ### 属性 @@ -162,6 +176,7 @@ const floating = ref(false) | `layout` | 排列方式,可选值为 `row` `column` | _string_ | `column` | | `fit` | 填充模式,可选值为 `fill` `contain` `cover` `none` `scale-down` | _string_ | `cover` | | `outline` | 是否使用外边框 | _boolean_ | `false` | +| `filled` | 是否使用填充 | _boolean_ | `false` | | `alt` | 替代文本,和 img 标签原生属性一致 | _string_ | `-` | | `image-height` | 图片高度 | _string \| number_ | `-` | | `image-width` | 图片宽度 | _string \| number_ | `-` | @@ -195,6 +210,7 @@ const floating = ref(false) | 变量名 | 默认值 | |-------------------------------------|----------------------| | `--card-background` | `var(--color-surface-container-highest)` | +| `--card-filled-background` | `hsla(0, 0%, 93%, 1)` | | `--card-padding` | `0px 0 15px 0` | | `--card-border-radius` | `4px` | | `--card-outline-color` | `var(--color-outline)` | diff --git a/packages/varlet-ui/src/card/example/index.vue b/packages/varlet-ui/src/card/example/index.vue index 06f409d1ba0..e24b3a18ba4 100644 --- a/packages/varlet-ui/src/card/example/index.vue +++ b/packages/varlet-ui/src/card/example/index.vue @@ -60,6 +60,9 @@ onThemeChange() {{ t('outline') }} + + {{ t('filled') }} +