element-plus
Version:
A Component Library for Vue 3
1 lines • 1.2 kB
Source Map (JSON)
{"version":3,"file":"directive.mjs","sources":["../../../../../../packages/components/popover/src/directive.ts"],"sourcesContent":["import type { DirectiveBinding, ObjectDirective } from 'vue'\nimport type { PopoverInstance } from './popover'\n\nconst attachEvents = (el: HTMLElement, binding: DirectiveBinding) => {\n const popperComponent: PopoverInstance = binding.arg || binding.value\n const popover = popperComponent?.popperRef\n if (popover) {\n popover.triggerRef = el\n }\n}\n\nexport default {\n mounted(el, binding) {\n attachEvents(el, binding)\n },\n updated(el, binding) {\n attachEvents(el, binding)\n },\n} as ObjectDirective\n\nexport const VPopover = 'popover'\n"],"names":[],"mappings":"AAGA,MAAM,YAAA,GAAe,CAAC,EAAA,EAAiB,OAAA,KAA8B;AACnE,EAAA,MAAM,eAAA,GAAmC,OAAA,CAAQ,GAAA,IAAO,OAAA,CAAQ,KAAA;AAChE,EAAA,MAAM,UAAU,eAAA,IAAA,IAAA,GAAA,MAAA,GAAA,eAAA,CAAiB,SAAA;AACjC,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAA,CAAQ,UAAA,GAAa,EAAA;AAAA,EACvB;AACF,CAAA;AAEA,uBAAe;AAAA,EACb,OAAA,CAAQ,IAAI,OAAA,EAAS;AACnB,IAAA,YAAA,CAAa,IAAI,OAAO,CAAA;AAAA,EAC1B,CAAA;AAAA,EACA,OAAA,CAAQ,IAAI,OAAA,EAAS;AACnB,IAAA,YAAA,CAAa,IAAI,OAAO,CAAA;AAAA,EAC1B;AACF,CAAA;AAEO,MAAM,QAAA,GAAW;;;;"}