<template>
  <view :class="swiperDotClass" :style="swiperDotStyle">
    <template v-if="type === 'fraction'">
      {{ current + 1 }}/{{ innerList.length }}
    </template>
    <template v-else-if="type === 'title'">
      <view :class="bem.e('item')">
        {{ current + 1 }}/{{ innerList.length }}
        {{ innerList[current]?.[field] }}
      </view>
    </template>
    <template v-else>
      <view
        v-for="(n, i) in innerList.length"
        :key="i"
        :class="
          classNames(bem.e('item'), bem.em('item', 'active', i === current))
        "
      >
        {{ type === 'index' ? n : '' }}
      </view>
    </template>
  </view>
</template>

<script lang="ts">
import { defineComponent as _defineComponent } from "vue";
import { computed } from "vue";
import { classNames, stringifyStyle, createBem } from "../utils";
import { swiperDotProps } from "./common";
const __default__ = {
  options: {
    virtualHost: true,
    styleIsolation: "shared"
  }
};
export default /* @__PURE__ */ _defineComponent({
  ...__default__,
  __name: "swiper-dot",
  props: swiperDotProps,
  setup(__props, { expose: __expose }) {
    __expose();
    const props = __props;
    const bem = createBem("swiper-dot");
    const innerList = computed(() => {
      return props.list ?? Array(props.total).fill("");
    });
    const swiperDotClass = computed(() => {
      return classNames(bem.b(), bem.m(props.type), props.rootClass);
    });
    const swiperDotStyle = computed(() => {
      return stringifyStyle(props.rootStyle);
    });
    const __returned__ = { props, bem, innerList, swiperDotClass, swiperDotStyle, get classNames() {
      return classNames;
    } };
    return __returned__;
  }
});
</script>

<style lang="scss">
@use './index.scss';
</style>