wd-swiper-nav.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  4. __name: "wd-swiper-nav",
  5. props: common_vendor.swiperNavprops,
  6. emits: ["change"],
  7. setup(__props, { emit: __emit }) {
  8. const emit = __emit;
  9. function handleNav(dir) {
  10. const source = "nav";
  11. emit("change", { dir, source });
  12. }
  13. return (_ctx, _cache) => {
  14. return common_vendor.e({
  15. a: _ctx.showControls
  16. }, _ctx.showControls ? {
  17. b: common_vendor.o(($event) => handleNav("prev")),
  18. c: common_vendor.o(($event) => handleNav("next"))
  19. } : {}, {
  20. d: _ctx.total >= _ctx.minShowNum
  21. }, _ctx.total >= _ctx.minShowNum ? common_vendor.e({
  22. e: _ctx.type === "dots" || _ctx.type === "dots-bar"
  23. }, _ctx.type === "dots" || _ctx.type === "dots-bar" ? {
  24. f: common_vendor.f(_ctx.total, (_, index, i0) => {
  25. return {
  26. a: index,
  27. b: common_vendor.n(`wd-swiper-nav__item--${_ctx.type} ${_ctx.current === index ? "is-active" : ""} is-${_ctx.direction}`)
  28. };
  29. })
  30. } : {}, {
  31. g: _ctx.type === "fraction"
  32. }, _ctx.type === "fraction" ? {
  33. h: common_vendor.t(_ctx.current + 1),
  34. i: common_vendor.t(_ctx.total)
  35. } : {}, {
  36. j: common_vendor.s(_ctx.customStyle),
  37. k: common_vendor.n(`wd-swiper-nav wd-swiper-nav--${_ctx.direction} wd-swiper-nav--${_ctx.type} wd-swiper-nav--${_ctx.indicatorPosition} ${_ctx.customClass}`)
  38. }) : {});
  39. };
  40. }
  41. });
  42. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fb3c54f0"]]);
  43. wx.createComponent(Component);