Swiper - v12.0.3
    Preparing search index...

    Interface VirtualMethods<T>

    interface VirtualMethods<T = any> {
        cache: object;
        from: number;
        slides: T[];
        to: number;
        appendSlide(slide: string | HTMLElement | string[] | HTMLElement[]): void;
        prependSlide(slide: string | HTMLElement | string[] | HTMLElement[]): void;
        removeAllSlides(): void;
        removeSlide(slideIndexes: number[]): void;
        update(force: boolean): void;
    }

    Type Parameters

    • T = any
    Index

    Properties

    cache: object

    Object with cached slides HTML elements

    from: number

    Index of first rendered slide

    slides: T[]

    Array with slide items passed by virtual.slides parameter

    to: number

    Index of last rendered slide

    Methods

    • Append slide. slides can be a single slide item or array with such slides.

      Parameters

      • slide: string | HTMLElement | string[] | HTMLElement[]

      Returns void

      Only for Core version (in React & Vue it should be done by modifying slides array/data/source)

    • Prepend slide. slides can be a single slide item or array with such slides.

      Parameters

      • slide: string | HTMLElement | string[] | HTMLElement[]

      Returns void

      Only for Core version (in React & Vue it should be done by modifying slides array/data/source)

    • Remove all slides

      Returns void

      Only for Core version (in React & Vue it should be done by modifying slides array/data/source)

    • Remove specific slide or slides. slideIndexes can be a number with slide index to remove or array with indexes.

      Parameters

      • slideIndexes: number[]

      Returns void

      Only for Core version (in React & Vue it should be done by modifying slides array/data/source)

    • Update virtual slides state

      Parameters

      • force: boolean

      Returns void