Disguise the drop-down box of select components in elementui as a tree structure

as shown in the question

        options2: [{
          value: "1",
          label: "",
          level:3
        }, {
          value: "2",
          label: "",
          disabled: true,
          level:2
        }, {
          value: "3",
          label: "",
          level:5
        }, {
          value: "4",
          label: "",
          level:2
        }, {
          value: "5",
          label: "",
          level:5
        }],
        value2: ""
      }
    }

the above is the data in select. How to judge how to add a few spaces before the data displayed in option according to the level field, for example, if level is 5, then there will be five spaces before the words of Beijing Roast Duck. The drop-down box made in this way is similar to the tree chart for guidance.

Apr.03,2021

https://jsfiddle.net/7dopkugq.


components modified based on el-select, learn about https://blog.csdn.net/Mr_Java.

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-1b3e979-4dac3.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-1b3e979-4dac3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?