Skip to content

Commit f8786a7

Browse files
teleskop150750productdevbook
authored andcommitted
feat: useLabel
1 parent c08683e commit f8786a7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/vue-primitives/src/label/Label.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export interface UseLabelEmits {
1212
onMousedown?: (event: MouseEvent) => void
1313
}
1414

15-
export function useLabel(emits?: UseLabelEmits) {
15+
export interface UseLabelReturns {
16+
onMousedown?: (event: MouseEvent) => void
17+
}
18+
19+
export function useLabel(emits?: UseLabelEmits): () => UseLabelReturns {
1620
function onMousedown(event: MouseEvent) {
1721
// only prevent text selection if clicking inside the label itself
1822
const target = event.target as HTMLElement

packages/vue-primitives/src/label/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export {
33
type LabelProps,
44
useLabel,
55
type UseLabelEmits,
6+
type UseLabelReturns,
67
} from './Label.ts'
78

89
export { default as Label } from './Label.vue'

0 commit comments

Comments
 (0)