How to customize the iviewui cascade selection?

<template>
    <Cascader :data="data" v-model="value2"></Cascader>
</template>
<script>
    export default {
        data () {
            return {
                value2: ["jiangsu", "suzhou", "zhuozhengyuan"],
                data: [{
                    value: "beijing",
                    label: "",
                    children: [
                        {
                            value: "gugong",
                            label: ""
                        },
                        {
                            value: "tiantan",
                            label: ""
                        },
                        {
                            value: "wangfujing",
                            label: ""
                        }
                    ]
                }, {
                    value: "jiangsu",
                    label: "",
                    children: [
                        {
                            value: "nanjing",
                            label: "",
                            children: [
                                {
                                    value: "fuzimiao",
                                    label: "",
                                }
                            ]
                        },
                        {
                            value: "suzhou",
                            label: "",
                            children: [
                                {
                                    value: "zhuozhengyuan",
                                    label: "",
                                },
                                {
                                    value: "shizilin",
                                    label: "",
                                }
                            ]
                        }
                    ],
                }]
            }
        }
    }
</script>

like the code value and label above, I can"t change every return item of my interface to value and label!

element-ui is fine. There is a props configuration. How to configure iviewui?

now the returned data format of the API is

    {
      "id": 1,
      "name": "1",
      "children":[
       {
        "id": 1,
        "name": "1"
      }
      ]
    },
    {
      "id": 2,
      "name": "2",
      "children": [
      {
        "id": 5,
        "name": "2"
      }
      ]
    },
Jun.23,2021

well, it really doesn't support your data structure. If you can't, just ask your students at the back end to change the

.

replace name with label and id with value

the source code is indeed fixed as mentioned above, and the picture above is from: casitem.vue

most of the names that really show each item are taken from label:

{{ data.label }}

you cannot customize
1
valuelabelchildren
label

unless you modify the source code.
Menu