mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-09-27 12:11:43 +02:00
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
import type { ElTooltip } from 'element-plus';
|
|
import { computed, type ComputedRef, inject, type InjectionKey, provide } from 'vue';
|
|
|
|
const TOOLTIP_APPEND_TO = 'TOOLTIP_APPEND_TO' as unknown as InjectionKey<Value>;
|
|
|
|
type Value = ComputedRef<InstanceType<typeof ElTooltip>['$props']['appendTo']>;
|
|
|
|
export function useProvideTooltipAppendTo(el: Value) {
|
|
provide(TOOLTIP_APPEND_TO, el);
|
|
}
|
|
|
|
export function useInjectTooltipAppendTo(): Value {
|
|
const injected = inject(
|
|
TOOLTIP_APPEND_TO,
|
|
computed(() => undefined),
|
|
);
|
|
|
|
return injected;
|
|
}
|