• 请不要在回答技术问题时复制粘贴 AI 生成的内容
rcocco
V2EX  ›  程序员

Vue3 哪些组件库有支持虚拟滚动和水平滚动的树形组件?

  •  
  •   rcocco · May 15, 2024 · 1767 views
    This topic created in 753 days ago, the information mentioned may be changed or developed.
    垂直方向能虚拟滚动,水平方向能普通的滚动就好了。
    试过 element plus 和 naive ui 的 Tree 组件,但它们都是启用虚拟滚动后,每个节点都变成固定宽度的。
    由于树每展开一层就会在左边加缩进,虚拟滚动下节点宽度又是固定的,当树层级很深的时候,深层的节点就啥也看不到了。
    2 replies    2024-05-15 17:32:27 +08:00
    rabbbit
        1
    rabbbit  
       May 15, 2024
    vxe-table
    rcocco
        2
    rcocco  
    OP
       May 15, 2024
    @rabbbit
    这个要怎么实现水平滚动呢?我按照虚拟树表格的 demo 没能弄出来水平滚动条,设置 scroll-x 属性也不生效。
    ```html
    <div style="width:150px">
    <vxe-table
    show-overflow
    height="400"
    ref="tableRef"
    :loading="loading"
    :show-header="false"
    :tree-config="{transform: true}"
    :scroll-y="{enabled: true, gt: 0}"
    :scroll-x="{enabled: true, gt: 15}"
    :data="tableData">
    <vxe-column field="name" title="Name" tree-node width="100%"></vxe-column>
    </vxe-table>
    </div>
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2836 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 09:02 · PVG 17:02 · LAX 02:02 · JFK 05:02
    ♥ Do have faith in what you're doing.