How to use the @egjs/flicking.DEFAULT_OPTIONS.lastIndex function in @egjs/flicking

To help you get started, weโ€™ve selected a few @egjs/flicking examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naver / egjs-flicking / packages / vue-flicking / src / Flicking.ts View on Github external
private $_getClonedVNodes() {
    const h = this.$createElement;
    const cloneCount = this.$_nativeFlicking
      ? this.$_nativeFlicking.getCloneCount()
      : 0;
    const lastIndex = this.$_nativeFlicking
      ? this.$_nativeFlicking.getLastIndex()
      : this.options.lastIndex || DEFAULT_OPTIONS.lastIndex;
    const slots = this.$_getSlots();
    const children = slots.slice(0, lastIndex + 1);
    const clones: VNode[] = [];

    for (let cloneIndex = 0; cloneIndex < cloneCount; cloneIndex++) {
      clones.push(...children.map((child, childIdx) => this.$_cloneVNode(child, h, cloneIndex, childIdx)));
    }
    return clones;
  }