Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

elemenu ui tree 获取和回显问题 求助

1.获取
数据为

{
    id: 1,
    label: '一级',
    children: [{
      id: 2,
      label: '二级',
      children: [{
        id: 3,
        label: '三级1'
      }, {
        id: 4,
        label: '三级2'
      }]
    }

现在需求 如全选之后 页面要展示 一级/二级/三级1,一级/二级/三级2

this.$refs.tree.getCheckedKeys()
        .concat(this.$refs.tree.getHalfCheckedKeys())

获取到的值 是所有的id集合 不知道怎么区分层级 来进行拼接

  1. 回显

default-checked-keys
赋值之后 只要有父id 就回全部选中 不论子选中的几个
想要 按照选中的样子 回显


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...