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

[bugfix] Card: centered prop not work #2589

Merged
merged 1 commit into from
Jan 22, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/card/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Use slot to custom content.
| num | Number | `String | Number` | - |
| price | Price | `String | Number` | - |
| origin-price | Origin price | `String | Number` | - |
| centered | Whether content vertical centered | `String` | `false` |
| currency | Currency symbol | `String` | `¥` |
| thumb-link | Thumb link URL | `String` | - |
| lazy-load | Whether to enable thumb lazy load,should register [Lazyload](#/en-US/lazyload) component | `Boolean` | `false` |
Expand Down
3 changes: 2 additions & 1 deletion packages/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default sfc({
desc: String,
thumb: String,
title: String,
centered: Boolean,
lazyLoad: Boolean,
thumbLink: String,
num: [Number, String],
Expand Down Expand Up @@ -67,7 +68,7 @@ export default sfc({
<div class={bem()}>
<div class={bem('header')}>
{Thumb}
<div class={bem('content')}>
<div class={bem('content', { centered: this.centered })}>
{Title}
{Desc}
{slots.tags}
Expand Down
14 changes: 8 additions & 6 deletions packages/card/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
margin-top: 10px;
}

&--center,
&__thumb {
align-items: center;
justify-content: center;
}

&__header {
display: flex;
}
Expand All @@ -29,6 +23,8 @@
height: 90px;
margin-right: 10px;
flex: none;
align-items: center;
justify-content: center;

img {
border: none;
Expand All @@ -39,9 +35,15 @@

&__content {
position: relative;
display: flex;
flex: 1;
height: 90px;
flex-direction: column;
min-width: 0; /* hack for flex box ellipsis */

&--centered {
justify-content: center;
}
}

&__title,
Expand Down
1 change: 1 addition & 0 deletions packages/card/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Vue.use(Card);
| num | 商品数量 | `String | Number` | - | - |
| price | 商品价格 | `String | Number` | - | - |
| origin-price | 商品划线原价 | `String | Number` | - | 1.3.6 |
| centered | 内容是否垂直居中 | `String` | `false` | - |
| currency | 货币符号 | `String` | `¥` | - |
| thumb-link | 点击左侧图片后的跳转链接 | `String` | - | 1.3.4 |
| lazy-load | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | `Boolean` | `false` | 1.5.0 |
Expand Down