forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColumnHeader.tsx
More file actions
29 lines (27 loc) · 1003 Bytes
/
ColumnHeader.tsx
File metadata and controls
29 lines (27 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { InfoFilled } from "@element-plus/icons-vue"
import Flex from "@pages/components/Flex"
import { ElIcon, ElTooltip } from "element-plus"
import { defineComponent, useSlots } from "vue"
const ColumnHeader = defineComponent<{ label: string, tooltipContent?: string }>(({ label, tooltipContent }) => {
const slots = useSlots()
return () => (
<Flex justify="center" align="center" gap={4}>
<span>{label}</span>
<ElTooltip
content={tooltipContent}
placement="top"
v-slots={{
content: slots.tooltipContent,
default: () => (
<Flex height='100%'>
<ElIcon>
<InfoFilled />
</ElIcon>
</Flex>
),
}}
/>
</Flex>
)
}, { props: ['label', 'tooltipContent'] })
export default ColumnHeader