Ant design vue echoes and clicks on the title to select the check box (no children's tree is available!)

 v-model: echoed data

Click the header to check the checkbox select event.

 <a-tree
          v-model="Ids"
          style="height: 500px;overflow-y: auto"
          checkable
          :tree-data="tagTreeData"
          :replace-fields="{children:'children', title:'name', key:'id'}"
          @select="select"
        />

select:

 select(e, ee) {
      if (this.Ids.indexOf(ee.node.dataRef.id) !== -1) {
        this.Ids = this.Ids.filter(item => item !== ee.node.dataRef.id)
      } else {
        this.Ids.push(ee.node.dataRef.id)
      }
    },

Echo: by assigning id to v-model

Guess you like

Origin blog.csdn.net/Blue54/article/details/129014138