676e58e3fa5f8d611ecc23077a2a5aab23ffb24c5f17c1ceca5d5eafc6cf77e8ac088c7af55670218d9490d2888b29e519b0631b0eee12187357a49f5dff34 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { defineComponent, computed, openBlock, createElementBlock, unref, toDisplayString, createBlock, withCtx, resolveDynamicComponent } from 'vue';
  2. import { ElIcon } from '../../../icon/index.mjs';
  3. import { paginationPrevProps, paginationPrevEmits } from './prev.mjs';
  4. import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
  5. import { useLocale } from '../../../../hooks/use-locale/index.mjs';
  6. const __default__ = defineComponent({
  7. name: "ElPaginationPrev"
  8. });
  9. const _sfc_main = /* @__PURE__ */ defineComponent({
  10. ...__default__,
  11. props: paginationPrevProps,
  12. emits: paginationPrevEmits,
  13. setup(__props) {
  14. const props = __props;
  15. const { t } = useLocale();
  16. const internalDisabled = computed(() => props.disabled || props.currentPage <= 1);
  17. return (_ctx, _cache) => {
  18. return openBlock(), createElementBlock("button", {
  19. type: "button",
  20. class: "btn-prev",
  21. disabled: unref(internalDisabled),
  22. "aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
  23. "aria-disabled": unref(internalDisabled),
  24. onClick: ($event) => _ctx.$emit("click", $event)
  25. }, [
  26. _ctx.prevText ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.prevText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  27. default: withCtx(() => [
  28. (openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))
  29. ]),
  30. _: 1
  31. }))
  32. ], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
  33. };
  34. }
  35. });
  36. var Prev = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "prev.vue"]]);
  37. export { Prev as default };
  38. //# sourceMappingURL=prev2.mjs.map