小编pro*_*pro的帖子

Material-UI:如何在 TreeView 中添加边框

在这里,我在 React 中有一个代码。我想在树的左侧显示虚线。

我怎样才能做到这一点?

我需要这样的东西:

在此处输入图片说明

而且,我想将 的样式TreeView与此代码合并:

const StyledTreeItem = withStyles((theme) => ({
        iconContainer: {
            '& .close': {
                opacity: 0.3,
            },
        },
        group: {
            marginLeft: 2,
            paddingLeft: 3,
            borderLeft: `1px dashed ${fade(theme.palette.text.primary, 0.4)}`,
        },
    }))((props) => <TreeItem {...props} />);
Run Code Online (Sandbox Code Playgroud)

编辑 https://codesandbox.io/s/green-surf-dcoqr?fontsize=14&hidenavigation=1&theme=dark&file=/src/tree.js:0-2494

"organizationalUnitsList": [
    {
      "organizationalUnitId": "",
      "organizationalUnitName": "A",
      "organizationalUnitsList": [
        {
          "organizationalUnitId": "",
          "organizationalUnitName": "b",
        }
      ]
    },
    {
      "organizationalUnitId": "",
      "organizationalUnitName": "C",
      "organizationalUnitsList": [
        {
          "organizationalUnitId": "",
          "organizationalUnitName": "D",
          "organizationalUnitsList": [
            {
               "organizationalUnitId": "",
               "organizationalUnitName": "e",
            }
         ]
        } …
Run Code Online (Sandbox Code Playgroud)

html javascript css reactjs material-ui

5
推荐指数
1
解决办法
493
查看次数

标签 统计

css ×1

html ×1

javascript ×1

material-ui ×1

reactjs ×1