element [Feature Request] el-tree data both support multi-level and single-level array.

5w9g7ksd  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(92)

Existing Component

Yes

Component Name

el-tree

Description

Now data (multi-level)
let treeData = [
  {
    label: 'level-1',
    children: [
      {
         label: 'level-2',
         children: [ ... ]
      }
    ]
  }
]
Maybe Better data (single-level)
let treeData = [
  {
    label: 'label-1',
    parentLabel: null
  },
  {
    label: 'label-2',
    parentLabel: 'label-1'
  },
  {
    label: 'label-3',
    parentLabel: 'label-2'
  }
]
Why we need single-level data?

Single-level data useful for F2E state management (Vuex, Redux or Flux) and B2E SQL normal response data.

单层数组对前端状态管理(Vuex,Redux 和 Flux)和后端默认 SQL 返回值更加友好。

aamkag61

aamkag611#

Translation of this issue:

Existing Component

Yes

Component Name

el-tree

Description

Now data (multi-level)
let treeData = [
{

label: 'level-1',
children: [

{
label: 'level-2',

children: [ ... ]
}

]
}

]
Maybe Better data (single-level)
let treeData = [
{

label: 'label-1',
parentLabel: null

}
{

label: 'label-2',
parentLabel: 'label-1'

}
{

label: 'label-3',
parentLabel: 'label-2'

}
]
Why we need single-level data?

Single-level data useful for F2E state management (Vuex, Redux or Flux) and B2E SQL normal response data.
Single layer array is more friendly for front-end state management (vuex, Redux and flux) and back-end SQL default return value.

bqujaahr

bqujaahr2#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题