Write a tree list with the recursive components of vue, and there is a question about the line display of the recursive structure.

vuejson:


afterbefore


if you want to judge a parent and a previous brother, it seems that CSS alone is not easy to implement.

I probably wrote a

online using JSFiddle.

implemented to look like this

clipboard.png

because I don't know your Dom structure

has little talent and learning, and makes a fool of himself
JSFiddle

the format of each recursive component is about

div.a  //div
    div.b //paddingdiv
        div.c //
        slot //

it should look like this

  <div class="a">
    <div class="b">
      <div class="c"></div>
      <slot />
    </div>
  </div>

then CSS uses .b {border-left:1px solid-sharp000;}

in order to achieve the long root, you need to judge when you create it. If the node has a second sibling node, div.a add a .long

. Add a sentence like this to

CSS.


.a.long{
  border-left:1px solid -sharp000;
}

.long>.b{
  border-left:none;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ebb-2c0c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ebb-2c0c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?