Thank you all for your answers. The problem has been solved. Thank you 
 var rr = [
    {"pid":0,"id":3,"name":"3"},
    {"pid":0,"id":4,"name":"4"},
    {"pid":4,"id":5,"name":"-4"},
    {"pid":5,"id":6,"name":"-4-1"},
    {"pid":0,"id":7,"name":"7"},
    {"pid":7,"id":8,"name":"-7"},
    {"pid":0,"id":9,"name":"9"},
    {"pid":9,"id":10,"name":"9-1"},
    {"pid":9,"id":11,"name":"9-2"},
    {"pid":11,"id":12,"name":"9-2-1"}];
ask God to help you recursively process the data in the above format into a format that can be used by vue routing. In the above data, a pid of 0 represents a first-level route, and a pid equals an id with a pid of 0 represents a second-level route. And so on.






