acf7de4eb118d32b1517043926bca1fd7fed775d9f0e5a5c5dda1be7a1b64e22c4f5d0c98c12a9554ac34f39c831c8c221173dbf7e482c7e878d16d2426d9a 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var index$1 = require('../../icon/index.js');
  5. var iconsVue = require('@element-plus/icons-vue');
  6. var backtop = require('./backtop.js');
  7. var useBacktop = require('./use-backtop.js');
  8. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  9. var index = require('../../../hooks/use-namespace/index.js');
  10. const COMPONENT_NAME = "ElBacktop";
  11. const __default__ = vue.defineComponent({
  12. name: COMPONENT_NAME
  13. });
  14. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  15. ...__default__,
  16. props: backtop.backtopProps,
  17. emits: backtop.backtopEmits,
  18. setup(__props, { emit }) {
  19. const props = __props;
  20. const ns = index.useNamespace("backtop");
  21. const { handleClick, visible } = useBacktop.useBackTop(props, emit, COMPONENT_NAME);
  22. const backTopStyle = vue.computed(() => ({
  23. right: `${props.right}px`,
  24. bottom: `${props.bottom}px`
  25. }));
  26. return (_ctx, _cache) => {
  27. return vue.openBlock(), vue.createBlock(vue.Transition, {
  28. name: `${vue.unref(ns).namespace.value}-fade-in`
  29. }, {
  30. default: vue.withCtx(() => [
  31. vue.unref(visible) ? (vue.openBlock(), vue.createElementBlock("div", {
  32. key: 0,
  33. style: vue.normalizeStyle(vue.unref(backTopStyle)),
  34. class: vue.normalizeClass(vue.unref(ns).b()),
  35. onClick: vue.withModifiers(vue.unref(handleClick), ["stop"])
  36. }, [
  37. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  38. vue.createVNode(vue.unref(index$1.ElIcon), {
  39. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  40. }, {
  41. default: vue.withCtx(() => [
  42. vue.createVNode(vue.unref(iconsVue.CaretTop))
  43. ]),
  44. _: 1
  45. }, 8, ["class"])
  46. ])
  47. ], 14, ["onClick"])) : vue.createCommentVNode("v-if", true)
  48. ]),
  49. _: 3
  50. }, 8, ["name"]);
  51. };
  52. }
  53. });
  54. var Backtop = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "backtop.vue"]]);
  55. exports["default"] = Backtop;
  56. //# sourceMappingURL=backtop2.js.map