How the elementUI tree control gets the selected id?

Page

clipboard.png

when I click OK, I will send the selected id to the background.

HTML:

<el-tree
  :data="data2"
  show-checkbox
  node-key="id"
  :default-expanded-keys="[1,4]"
  :default-checked-keys="[1,6]"
  :props="defaultProps">
</el-tree>

data:

data2: [ 
    {
        id: 1,
        label: "",
        children: [
            {
                id: 2,
                label: "",
            },                    
            {
                id: 3,
                label: "",
            },
        ]
    }, 
    {
        id: 4,
        label: "",
        children: [
            {
                id: 5,
                label: ""
            }, 
            {
                id: 6,
                label: ""
            }
        ]
    }, 
],

demo


this.$refs.roles.getCheckedKeys ()

Menu