UNPKG

comic-plus

Version:

<p align="center"> <img width="200px" src="./logo.png"/> </p>

29 lines (28 loc) 748 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const tooltip = require("./src/tooltip.js"); const SCOPE = "__TOOLTIP__"; const useTooltip = function() { return { mounted(el, binding) { el[SCOPE] = tooltip.createTooltip(el, binding.value, binding.arg); }, updated(el, binding) { var _a, _b; (_b = (_a = el[SCOPE]) == null ? void 0 : _a.update) == null ? void 0 : _b.call(_a, binding.value); }, unmounted(el) { if (el[SCOPE]) { el[SCOPE].destroy(); delete el[SCOPE]; } } }; }; const vTooltip = { install: function(app) { app.directive("tooltip", useTooltip()); } }; exports.useTooltip = useTooltip; exports.vTooltip = vTooltip;