Skip to content

useTableScrollY

计算屏幕高度减去固定高度,得出表格内部滚动高度 ref值。然后使用表格提供的 setProps 函数,修改表格的滚动区域高度

实现代码
tsx
const scrollY = useTableScrollY({ fixedHeight: 240 });

watch(scrollY, () => {
  // 掉 table 提供的 setProps
  setProps({ scroll: { y: scrollY.value } });
});

API

属性描述类型默认值
fixedHeight固定高度number-
throttleTime节流的时间范围(毫秒)number1000