In vue+element-ui, how does the Cascader cascade selector use the children option in prop?

in element-ui, when using the Cascader cascading selector, you can call children data, but cannot select, how to solve this situation?

Html Code

  <el-cascader :options="options" v-model="selectedOptions" @change="handleChange" placeholder="" class="content" :props="props">

js Code

 props: {
        value: "name",
        label: "name",
        children: "items"
      },
      
      // 
 beforeCreate() {
    this.axios
      .post(`/api/services/app/tenant/GetTreeTenant`)
      .then(response => {
        console.log(response.data.result);
        this.options = response.data.result;
      })
      .catch(function(error) {
        console.log(error);
      });
  },

here is the data returned by the API. The main option is name, children. Name



under this items.

in this case, the data is not successfully bound. You requested the data in beforeCreate. It is recommended to obtain the data in created

. < hr >

and, ah, you still have items in this and it is empty, so there will be three-level options, but there is no data in the third-level options


Last level items should not be an empty array

Menu