reactjs - React-sortable-tree 节点高度增量问题
问题描述
如图所示,我在 react-sortable-tree 中有两个节点。默认情况下,包提供的行高约为 61px,如果我将行的大小增加到 84px,那么这两行就会相交,有什么办法吗?我尝试操纵 css 但找不到解决方案...
我应用的 CSS 样式是
.rstcustom__rowWrapper {
padding: 10px 10px 10px 0;
height: 84px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
cursor: move;
}
解决方案
添加:
<SortableTree
...
treeData={state}
rowHeight={}// multiple of base height for example
generateNodeProps={({ node, path }) => {
...
rowHeight 作为 SortableTree 组件中的道具。避免直接更改 CSS,使用文档中描述的 style、rowHeight、innerStyle 道具
推荐阅读
- python - Python:如何将字符串格式的(utf-8)字节数组对象解码回字符串?
- sanity - 如何在 Sanity.io 中自定义字符串?(自动填充)
- python - 如何将 git 中 __init__.py 的内容(并维护历史记录)传输到另一个文件,同时仍然保持空的 __init__.py
- python - 每个循环按顺序初始化一个新列表以保存不同的值
- flutter - 如何在列表视图中制作标签栏和标签栏视图?
- rust - it is possible to turn a seft-owned variable to static lifetime?
- javascript - 制作适合多人游戏的画布视口
- javascript - 获取 TypeError:jquery__WEBPACK_IMPORTED_MODULE_1___default(...)(...).fancybox 不是函数
- html - Bootstrap 列 - 3 列,中心列最大化尺寸
- jquery - jquery 插件 .append .each 和一个 uniqe id