-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Timeline: add timeline component #11736
Conversation
Deploy preview for element ready! Built with commit a09b604 |
<el-timeline reverse>
<el-timeline-item>1</el-timeline-item>
<el-timeline-item>2</el-timeline-item>
<el-timeline-item>3</el-timeline-item>
</el-timeline>
|
这里 reverse 和实际排序没关系,只是能够反转原来的排序……感觉是和交互稿有点出入,稍后我确认下 |
排序行为修正,默认为正序排列 |
packages/timeline/src/item.vue
Outdated
class="el-timeline-item__node" | ||
:class="[ | ||
`el-timeline-item__node--${size}`, | ||
`el-timeline-item__node--${type}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样写的话,可能会出现 el-timeline-item__node--undefined
这种类名的。不如改成以对象的形式绑定类名。
|
||
watch: { | ||
reverse: { | ||
handler(newVal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我试了一下,直接调用 reverse 也是生效的。
this.$slots.default = [...this.$slots.default].reverse();
test/unit/specs/timeline.spec.js
Outdated
}, true); | ||
|
||
const timestampElm = vm.$el.querySelectorAll('.el-timeline-item__timestamp')[0]; | ||
expect(toArray(timestampElm.classList)).to.contain('is-top'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classList 有一个 contains 方法,直接返回布尔值了。不用再去转成数组了。
* Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
* Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
Timeline这个新特性很实用 👍 ,期待下个版本发布! |
* Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
* Table: fix params order of row events (#12086) * Timeline: add timeline component (#11736) * Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
* Table: fix params order of row events (ElemeFE#12086) * Timeline: add timeline component (ElemeFE#11736) * Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
* Table: fix params order of row events (ElemeFE#12086) * Timeline: add timeline component (ElemeFE#11736) * Timeline: add timeline component * Timeline: add timeline component * Timeline: add test case * Timeline: fix icon class * Timeline: update docs * Timeline: fix test case * Timeline: remove pending attribute * Timeline: fix docs * Timeline: make reverse default to false * Timline: fix test case * Timeline: update element-ui.d.ts * Timeline: optimize code
No description provided.