GithubHelp home page GithubHelp logo

el-tree增加虚拟滚动后,深度搜索结果树,在滚动中出现空白偏移。如果能在深度搜索中,匹配文字可以特殊标记就更好。 about element HOT 4 OPEN

femessage avatar femessage commented on September 17, 2024
el-tree增加虚拟滚动后,深度搜索结果树,在滚动中出现空白偏移。如果能在深度搜索中,匹配文字可以特殊标记就更好。

from element.

Comments (4)

Victor-dreamer avatar Victor-dreamer commented on September 17, 2024 3

element的tree是通过一个visible变量来控制树节点的显示的,可能是传入vue-virtual-scroll-list的data-sources数据和实际显示的节点不一致导致的显示错误,
可以尝试在tree.vue中的flattenTree方法中添加一个判断,过滤掉传入data-sources的数据

flattenTree(datas) {
  return datas.reduce((conn, data) => {
    if (data.visible) { // 添加一个判断
      conn.push(data); 
    }
    if (data.expanded && data.childNodes.length) {
      conn.push(...this.flattenTree(data.childNodes));
    }
    return conn;
  }, []);
 },

from element.

NoPersonal-git avatar NoPersonal-git commented on September 17, 2024

过滤掉传入数据不现实 如果tree组件有勾选功能 数据过滤了怎么勾选 filter-node-method节点的样式是display:none 整体tree的padding计算时候没考虑style:none节点。

from element.

nanmu32 avatar nanmu32 commented on September 17, 2024

element的tree是通过一个visible变量来控制树节点的显示的,可能是传入vue-virtual-scroll-list的data-sources数据和实际显示的节点不一致导致的显示错误,
可以尝试在tree.vue中的flattenTree方法中添加一个判断,过滤掉传入data-sources的数据

flattenTree(datas) {
  return datas.reduce((conn, data) => {
    if (data.visible) { // 添加一个判断
      conn.push(data); 
    }
    if (data.expanded && data.childNodes.length) {
      conn.push(...this.flattenTree(data.childNodes));
    }
    return conn;
  }, []);
 },

你的这种方法可以使用,他的数据存在node里面并没有破坏原始数据,还能及时更新虚拟滚动的列表

from element.

NoPersonal-git avatar NoPersonal-git commented on September 17, 2024

element的tree是通过一个visible变量来控制树节点的显示的,可能是传入vue-virtual-scroll-list的data-sources数据和实际显示的节点不一致导致的显示错误,
可以尝试在tree.vue中的flattenTree方法中添加一个判断,过滤掉传入data-sources的数据

flattenTree(datas) {
  return datas.reduce((conn, data) => {
    if (data.visible) { // 添加一个判断
      conn.push(data); 
    }
    if (data.expanded && data.childNodes.length) {
      conn.push(...this.flattenTree(data.childNodes));
    }
    return conn;
  }, []);
 },

你的这种方法可以使用,他的数据存在node里面并没有破坏原始数据,还能及时更新虚拟滚动的列表
能更新到你的git上吗这个方法

from element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.