mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 17:31:02 +08:00
77c7225a9d
- Add entry for table-v2 - Add basic usage for table-v2
30 lines
637 B
TypeScript
30 lines
637 B
TypeScript
import type { CSSProperties } from 'vue'
|
|
|
|
export const BAR_MAP = {
|
|
vertical: {
|
|
offset: 'offsetHeight',
|
|
scroll: 'scrollTop',
|
|
scrollSize: 'scrollHeight',
|
|
size: 'height',
|
|
key: 'vertical',
|
|
axis: 'Y',
|
|
client: 'clientY',
|
|
direction: 'top',
|
|
},
|
|
horizontal: {
|
|
offset: 'offsetWidth',
|
|
scroll: 'scrollLeft',
|
|
scrollSize: 'scrollWidth',
|
|
size: 'width',
|
|
key: 'horizontal',
|
|
axis: 'X',
|
|
client: 'clientX',
|
|
direction: 'left',
|
|
},
|
|
} as const
|
|
|
|
export const renderThumbStyle = ({ move, size, bar }): CSSProperties => ({
|
|
[bar.size]: size,
|
|
transform: `translate${bar.axis}(${move}%)`,
|
|
})
|