forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBox.tsx
More file actions
22 lines (19 loc) · 620 Bytes
/
Box.tsx
File metadata and controls
22 lines (19 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { defineComponent, h, useSlots } from "vue"
import { ALL_BASE_PROPS, type BaseProps, cvt2BaseStyle } from "./common"
const Box = defineComponent<BaseProps>(props => {
const { default: defaultSlots } = useSlots()
return () => (
<div
id={props.id}
class={props.class}
onClick={props.onClick}
style={{
display: props.inline ? 'inline-block' : 'block',
...cvt2BaseStyle(props),
}}
>
{defaultSlots && h(defaultSlots)}
</div>
)
}, { props: ALL_BASE_PROPS })
export default Box