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

Tree with line style #3854

Closed
afc163 opened this issue Nov 15, 2016 · 17 comments
Closed

Tree with line style #3854

afc163 opened this issue Nov 15, 2016 · 17 comments
Assignees

Comments

@afc163
Copy link
Member

afc163 commented Nov 15, 2016

image

@edutrul
Copy link

edutrul commented Nov 15, 2016

I am trying to accomplish the same "Tree with icons" any updates on how to do this ?
tree_with_icons

@benjycui
Copy link
Contributor

@edutrul maybe you can override style to do so?

@plandem
Copy link
Contributor

plandem commented Nov 19, 2016

i tried few times (maybe spent not enough time), but had few glitches every time.

@ddcat1115
Copy link
Contributor

ddcat1115 commented Dec 2, 2016

@warmhug 目前 rc-tree 的 showline 好像有点问题:

http://react-component.github.io/tree/examples/contextmenu.html

span.rc-tree-switchercenter_x / bottom_x,还有 ul.rc-tree-line 的设置貌似不太对

@warmhug
Copy link
Contributor

warmhug commented Dec 2, 2016

@ddcat1115 先加上 checkable 属性,当时做的时候和这个绑定了,随后要分离下。

@ddcat1115
Copy link
Contributor

目前 checkable 的 rc-tree 对是否是 bottom 的认定方式也和顶部的设计不一样:

  • rc-tree:一个ul中的最后一项 rc-tree-switcher 才是 bottom
  • 设计:一个ul中,若这一项后面没有可展开的项了,它的 rc-tree-switcher 就是bottom,后面不会有连接线

@warmhug 看下是否rc-tree这里的认定方式需要修改下?或者设计修改下?

@warmhug
Copy link
Contributor

warmhug commented Dec 5, 2016

rc-tree 的线条设计和这里一样 http://www.treejs.cn/v3/demo.php#_101 我觉得没问题

@warmhug
Copy link
Contributor

warmhug commented Dec 5, 2016

不显示 icon 时是这样子,叶子节点前的线条还是要有的、不然感觉也缺少点什么。设计上考虑改下吧
image

@ddcat1115
Copy link
Contributor

如果叶子节点也要连起来,建议叶子节点也带icon,设计中『基本样式』里面看起来是没有的,『带icon的样式』里貌似又有。。。

@warmhug
Copy link
Contributor

warmhug commented Dec 5, 2016

叶子节点也带icon,这个考虑下在 antd 里包装下吧。现在 rc-tree 和 ztree 不一样的是,设置 showIcon={false} 时,rc-tree 是不渲染 icon 节点;ztree 是还渲染节点,但用样式隐藏掉、而对于叶子节点 icon 不隐藏。自定义 icon 的方式也不一样,rc-tree 自定义 icon 在 TreeNode title 属性里定义,可以在 antd 里对 leaf 节点设置自定义 icon,再设置线条样式即可。

@warmhug
Copy link
Contributor

warmhug commented Dec 5, 2016

@ddcat1115 showLine 问题已修复,不用再加上 checkable 属性了。示例 http://react-component.github.io/tree/examples/contextmenu.html

另外 antd 的 tree 或 tree-select 里去掉使用 a 标签
image
设置的样式,参考 rc-tree 的新样式设置 https://github.com/react-component/tree/blob/master/assets/index.less#L11 。以后 rc-tree 要去掉 a 标签。

以后 rc-tree / rc-tree-select 的维护主要由 @yesmeck 来负责(有什么不确定的问题或需要 review 的可以@我)

@aw6658913
Copy link

样式通过引入rc-tree的assets样式,那请问如下图中的出现子节点旁边的操作是通过什么实现的呢
image

@yesmeck
Copy link
Member

yesmeck commented Feb 18, 2017

@aw6658913 使用问题建议到 StackOverflow 或 SegmentFault 上问。

你的问题可以参考 http://react-component.github.io/tree/examples/basic.html

@afc163
Copy link
Member Author

afc163 commented Mar 3, 2017

这个有进展么,要不 @benjycui#4932 一起搞掉?

@ddcat1115
Copy link
Contributor

额。。。这个之前搞了一半,后来忘记了。。。我这周提交掉吧,跟 @benjycui 那个 issue 的内容区别还是挺大的

不过目前的样式,以及 #4932 里的样式看起来,hover及选中都是添加背景色,这个 issue 确定是要改字体颜色?还是只针对 line style 的树的hover及选中才改字体颜色?

@thuzhangjw
Copy link

thuzhangjw commented Aug 1, 2017

能不能在选择showline时,把叶子节点前的那个图标给去了啊,或者有去掉的办法吗

@Here21
Copy link

Here21 commented Mar 14, 2018

楼上 +1

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

No branches or pull requests

10 participants