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

Timeline: add timeline component #11736

Merged
merged 12 commits into from
Aug 15, 2018
Merged

Timeline: add timeline component #11736

merged 12 commits into from
Aug 15, 2018

Conversation

jikkai
Copy link
Contributor

@jikkai jikkai commented Jun 25, 2018

No description provided.

@element-bot
Copy link
Member

element-bot commented Jun 25, 2018

Deploy preview for element ready!

Built with commit a09b604

https://deploy-preview-11736--element.netlify.com

@jikkai jikkai changed the title [WIP]Timeline: add timeline component Timeline: add timeline component Jun 29, 2018
@Leopoldthecoder
Copy link
Contributor

  <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>

reversetrue 的话,是不是应该渲染为 3 2 1

@jikkai
Copy link
Contributor Author

jikkai commented Jun 30, 2018

这里 reverse 和实际排序没关系,只是能够反转原来的排序……感觉是和交互稿有点出入,稍后我确认下

@jikkai
Copy link
Contributor Author

jikkai commented Jul 2, 2018

排序行为修正,默认为正序排列

class="el-timeline-item__node"
:class="[
`el-timeline-item__node--${size}`,
`el-timeline-item__node--${type}`
Copy link
Contributor

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) {
Copy link
Contributor

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();

}, true);

const timestampElm = vm.$el.querySelectorAll('.el-timeline-item__timestamp')[0];
expect(toArray(timestampElm.classList)).to.contain('is-top');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classList 有一个 contains 方法,直接返回布尔值了。不用再去转成数组了。

@ziyoung ziyoung merged commit 833a3ba into ElemeFE:next Aug 15, 2018
@jikkai jikkai deleted the feat/timeline branch August 15, 2018 03:15
jikkai added a commit that referenced this pull request Aug 22, 2018
* 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
jikkai added a commit that referenced this pull request Aug 28, 2018
* 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
@frontbear
Copy link

Timeline这个新特性很实用 👍 ,期待下个版本发布!

island205 pushed a commit that referenced this pull request Jan 28, 2019
* 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
island205 added a commit that referenced this pull request Feb 1, 2019
* 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
weisiren168 pushed a commit to weisiren168/element that referenced this pull request Jun 20, 2019
* 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
lzq4047 pushed a commit to lzq4047/element that referenced this pull request May 22, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants