Ant Design Vue的tree树,样式连接线与文本溢出隐藏

 效果图

html代码

 <a-tree
  :treeData="docTree"
 >
        <span slot="title" slot-scope="{ title }">
          <span :title="title">{{ title }}</span>
        </span>
      </a-tree>

CSS代码

@set-color: #7c7c7c;
/deep/.ant-tree-child-tree.ant-tree-child-tree-open > li:first-child {
  padding-top: 4px;
}
.last-menu-line() {
  position: absolute;
  left: 12px;
  width: 1px;
  height: 100%;
  margin: 22px 0 0;
  border-left: 1px dotted @set-color;
  content: ' ';
}
.ant-tree /deep/li {
  position: relative;
  &:before {
    position: absolute;
    left: 12px;
    width: 1px;
    height: 100%;
    height: calc(100% - 45px);
    margin: 22px 0 0;
    border-left: 1px dotted @set-color;
    content: ' ';
  }
  .ant-tree-node-content-wrapper {
    padding: 0;
    width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .ant-tree-child-tree.ant-tree-child-tree-open > li {
    &::after {
      content: '';
      position: absolute;
      width: 8px;
      height: 1px;
      border-top: 1px dotted @set-color;
      background: transparent;
      top: 15.5px;
      left: -5px;
      margin: 0;
    }
    .ant-tree-switcher-noop {
      height: 1px;
      border-top: 1px dotted @set-color;
      top: 11.5px;
      left: 4px;
      margin: 0;
      width: 18px;
      margin-right: 6px;
    }
  }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值