useTableScrollY
计算屏幕高度减去固定高度,得出表格内部滚动高度 ref值。然后使用表格提供的 setProps 函数,修改表格的滚动区域高度
实现代码
tsx
const scrollY = useTableScrollY({ fixedHeight: 240 });
watch(scrollY, () => {
// 掉 table 提供的 setProps
setProps({ scroll: { y: scrollY.value } });
});API
| 属性 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| fixedHeight | 固定高度 | number | - |
| throttleTime | 节流的时间范围(毫秒) | number | 1000 |