-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Description
Element UI version
2.15.1
OS/Browsers version
Vue version
2.6.12
Reproduction Link
https://jsfiddle.net/4vwt3mz0/11/
Steps to reproduce
<el-row />
设置为 type=flex
, 其中放置两个不同 size
的 <el-button />
What is Expected?
size
更小的 el-button
,其高度应该更小,并且因为 el-row
的 align
属性默认值为 "top"
, 两个按钮应顶部对齐
What is actually happening?
两个按钮的对齐方式为 strech
, 并且显式声明 el-row
的 align
属性为 "top"
也不生效。
其他描述
根据 MDN, align-items
属性的默认值为 normal
, 含义如下:
normal
The effect of this keyword is dependent of the layout mode we are in:
- In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
- In static position of absolutely-positioned layouts, the keyword behaves as stretch.
- For flex items, the keyword behaves as stretch.
- For grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
The property doesn't apply to block-level boxes, and to table cells.
代码实现中,当 align
为 top
时, 应将 align-items
属性设置为 flex-start
, 而不是忽略:
element/packages/row/src/row.js
Lines 36 to 46 in 0606cb8
render(h) { | |
return h(this.tag, { | |
class: [ | |
'el-row', | |
this.justify !== 'start' ? `is-justify-${this.justify}` : '', | |
this.align !== 'top' ? `is-align-${this.align}` : '', | |
{ 'el-row--flex': this.type === 'flex' } | |
], | |
style: this.style | |
}, this.$slots.default); | |
} |
Metadata
Metadata
Assignees
Labels
No labels