element-plus
Version:
A Component Library for Vue 3
1 lines • 1.23 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,OAA8B,KAAA;AACnE,EAAM,MAAA,eAAA,GAAmC,OAAQ,CAAA,GAAA,IAAO,OAAQ,CAAA,KAAA,CAAA;AAChE,EAAA,MAAM,UAAU,eAAiB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,eAAA,CAAA,SAAA,CAAA;AACjC,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,OAAA,CAAQ,UAAa,GAAA,EAAA,CAAA;AAAA,GACvB;AACF,CAAA,CAAA;AAEA,uBAAe;AAAA,EACb,OAAA,CAAQ,IAAI,OAAS,EAAA;AACnB,IAAA,YAAA,CAAa,IAAI,OAAO,CAAA,CAAA;AAAA,GAC1B;AAAA,EACA,OAAA,CAAQ,IAAI,OAAS,EAAA;AACnB,IAAA,YAAA,CAAa,IAAI,OAAO,CAAA,CAAA;AAAA,GAC1B;AACF,CAAA,CAAA;AAEO,MAAM,QAAW,GAAA;;;;"}