arrow2.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var constants = require('./constants.js');
  5. var arrow = require('./arrow.js');
  6. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  7. const __default__ = vue.defineComponent({
  8. name: "ElTooltipV2Arrow"
  9. });
  10. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  11. ...__default__,
  12. props: {
  13. ...arrow.tooltipV2ArrowProps,
  14. ...arrow.tooltipV2ArrowSpecialProps
  15. },
  16. setup(__props) {
  17. const props = __props;
  18. const { ns } = vue.inject(constants.tooltipV2RootKey);
  19. const { arrowRef } = vue.inject(constants.tooltipV2ContentKey);
  20. const arrowStyle = vue.computed(() => {
  21. const { style, width, height } = props;
  22. const namespace = ns.namespace.value;
  23. return {
  24. [`--${namespace}-tooltip-v2-arrow-width`]: `${width}px`,
  25. [`--${namespace}-tooltip-v2-arrow-height`]: `${height}px`,
  26. [`--${namespace}-tooltip-v2-arrow-border-width`]: `${width / 2}px`,
  27. [`--${namespace}-tooltip-v2-arrow-cover-width`]: width / 2 - 1,
  28. ...style || {}
  29. };
  30. });
  31. return (_ctx, _cache) => {
  32. return vue.openBlock(), vue.createElementBlock("span", {
  33. ref_key: "arrowRef",
  34. ref: arrowRef,
  35. style: vue.normalizeStyle(vue.unref(arrowStyle)),
  36. class: vue.normalizeClass(vue.unref(ns).e("arrow"))
  37. }, null, 6);
  38. };
  39. }
  40. });
  41. var TooltipV2Arrow = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "arrow.vue"]]);
  42. exports["default"] = TooltipV2Arrow;
  43. //# sourceMappingURL=arrow2.js.map