-
-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
add: timeline mode stamp #18035
Closed
Closed
add: timeline mode stamp #18035
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
我感觉这两个 mode 都没必要了。
mode="left"
+ label === label-leftThere 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.
这个自动的比较好,没必要这么复杂,如果有
label
就根据mode
当前的位置自动适应左右就好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.
😂😂😂 感觉 这样处理起来有点 复杂呀
如果使用一个
mode
,单个model
的样式 有两套。按照现有的定义,需要修改
tail
、head
、head-custom
、content
。比如啊:
ant-timeline-item-right
的定义是在Timeline.tsx
文件中Timeline.tsx
是不太好获取label
的值right
模式 和label-right
模式 都使用的是ant-timeline-item-right
的父 classTimelineItem.tsx
中 使用的是相同的父 class ,即tail
head
content
按照现在的 class 是无法分开的。要实现这个功能的话:
1 最直接分开 mode,
tail
、head
、head-custom
、content
再定义一套2 无新 mode,
tail
head
content
等 class 分2个,这样改动很大。TimelineItem.tsx
需要判断 所有的 item 中,是否有一个 是有值的,才启动 lable 模式3 无新 mode,
tail
head
content
也使用现有的。但是需要自动适配 label 的有无。同样需要 循环判断 是否启动 label ,并且 现有的 4个div css 基本需要都改动。而且 改动 难度 都较大。😅😅😅
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.
和
ant-timeline-item-content
并列放置一个ant-timeline-item-label
,根据ant-timeline-item-[right/left]
来定位label
的位置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.
但是这个时候,
tail
head
content
的位置 大小 都发生了变动 在一个ant-timeline-item-right
里,不太容易 进行2个定义吧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.
@shaodahong
还是有点疑问
如果
像这样的,只在最后一个 item 写了 label,这种情况下,如果要启用 label 模式,则在 li 层 增加 ant-timeline-label 样式时,这就需要遍历完成后 才能判断 。
当前代码的 遍历 是在处理 每一个 item 的 样式
所以 我感觉 还是需要 2个 遍历啊
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.
你 在上面说的 .some
是在每一个 item 去执行总的数组中去判断 是否 有一个有 label 吗?
这样 每一次 都执行个 some 不太好吧
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.
恩。现在的代码已经拿到了要渲染的
childrens
再 some 一下
之后吧样式设置下
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.
😂 嗯,那就行。。。
之前 一直 想规避 这个 2次的遍历,还以为你们不接受 2次 遍历呢
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.
我不知道官方接不接收,但是这个性能影响几乎忽略不计