Fxiaoke Developer Manual Fxiaoke Developer Manual
  • APL Development Manual
  • PWC Development Manual
  • OpenAPI Documentation
  • Custom Components (PC)
  • Custom Components (Mini Program)
  • Custom Plugins (PC)
  • Custom Plugins (Mini Program)
  • Third-party Integration Plugins (H5)
  • API (PC)
  • API (Mini Program)
  • Fx DevTools
Update Log
  • 简体中文
  • English
  • Custom Components (PC)
  • Custom Components (Mini Program)
  • Custom Plugins (PC)
  • Custom Plugins (Mini Program)
  • Third-party Integration Plugins (H5)
  • API (PC)
  • API (Mini Program)
  • Fx DevTools
Update Log
  • 简体中文
  • English
  • Getting Started

  • Components

    • Component Overview
    • UI Components

      • Button
      • Radio
      • Checkbox
      • Input
      • Input Number
      • Select
      • Cascader
      • Switch
      • Time Picker
      • Date Picker
      • DateTime Picker
      • Upload
      • Color Picker
      • Table
      • Tag
      • Progress
      • Tree
      • Pagination
      • Badge
      • Alert
      • Message
      • MessageBox
      • Notification
      • Dropdown
      • Steps
      • Dialog
      • Card
      • Calendar
      • Tooltip
      • Popover
      • Collapse
      • Carousel
      • Business Components

    • Examples

    • FAQ

    Table of Contents

    Carousel

    # FxCarousel Carousel

    Displays content like images or text in a limited space with cyclic playback.

    # Carousel Attributes

    Parameter Description Type Options Default
    height Height of the carousel string — —
    initial-index Index of initially active slide (starting from 0) number — 0
    trigger How indicators are triggered string click —
    autoplay Whether to automatically switch slides boolean — true
    interval Interval for auto-switching (milliseconds) number — 3000
    indicator-position Position of indicators string outside/none —
    arrow When to show arrow buttons string always/hover/never hover
    type Type of the carousel string card —
    loop Whether to display items in loop boolean - true
    direction Display direction string horizontal/vertical horizontal

    # Carousel Events

    Event Name Description Parameters
    change Triggers when slide changes Index of current active slide, index of previous slide

    # Carousel Methods

    Method Description Parameters
    setActiveItem Manually switch slides Index of target slide (starting from 0), or the name of target el-carousel-item
    prev Switch to previous slide —
    next Switch to next slide —

    # Carousel-Item Attributes

    Parameter Description Type Options Default
    name Name of the slide, used for setActiveItem string — —
    label Text content for corresponding indicator string — —

    # Basic Usage

    Basic usage suitable for most scenarios.

    Default hover trigger

    1

    2

    3

    4

    Click trigger

    1

    2

    3

    4

    Combine el-carousel and el-carousel-item tags to create a carousel. Slide content can be anything placed inside el-carousel-item. By default, hovering over indicators triggers switching. Set trigger to click for click-triggered switching.

    <template>
      <div class="block">
        <span class="demonstration">Default hover trigger</span>
        <fx-carousel height="150px">
          <fx-carousel-item v-for="item in 4" :key="item">
            <h3 class="small">{{ item }}</h3>
          </fx-carousel-item>
        </fx-carousel>
      </div>
      <div class="block">
        <span class="demonstration">Click trigger</span>
        <fx-carousel trigger="click" height="150px">
          <fx-carousel-item v-for="item in 4" :key="item">
            <h3 class="small">{{ item }}</h3>
          </fx-carousel-item>
        </fx-carousel>
      </div>
    </template>
    
    <style>
      .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 150px;
        margin: 0;
      }
    
      .el-carousel__item:nth-child(2n) {
         background-color: #99a9bf;
      }
      
      .el-carousel__item:nth-child(2n+1) {
         background-color: #d3dce6;
      }
    </style>
    
    Expand Copy Copy

    # Indicators

    Position indicators outside the container.

    1

    2

    3

    4

    The indicator-position property defines indicator location. Default shows inside carousel, outside displays externally, and none hides indicators.

    <template>
      <fx-carousel indicator-position="outside">
        <fx-carousel-item v-for="item in 4" :key="item">
          <h3>{{ item }}</h3>
        </fx-carousel-item>
      </fx-carousel>
    </template>
    
    <style>
      .el-carousel__item h3 {
        color: #475669;
        font-size: 18px;
        opacity: 0.75;
        line-height: 300px;
        margin: 0;
      }
      
      .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
      }
      
      .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
      }
    </style>
    
    Expand Copy Copy

    # Arrow Buttons

    Control when navigation arrows appear.

    1

    2

    3

    4

    The arrow property controls arrow visibility. Default shows on hover (hover), always keeps visible, and never hides them.

    <template>
      <fx-carousel :interval="5000" arrow="always">
        <fx-carousel-item v-for="item in 4" :key="item">
          <h3>{{ item }}</h3>
        </fx-carousel-item>
      </fx-carousel>
    </template>
    
    <style>
      .el-carousel__item h3 {
        color: #475669;
        font-size: 18px;
        opacity: 0.75;
        line-height: 300px;
        margin: 0;
      }
      
      .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
      }
      
      .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
      }
    </style>
    
    Expand Copy Copy

    # Card Style

    Use card mode when horizontal space is ample but vertical space is limited.

    1

    2

    3

    4

    5

    6

    Set type to card to enable card mode. The main difference is direct clicking on side slides for navigation.

    <template>
      <fx-carousel :interval="4000" type="card" height="200px">
        <fx-carousel-item v-for="item in 6" :key="item">
          <h3 class="medium">{{ item }}</h3>
        </fx-carousel-item>
      </fx-carousel>
    </template>
    
    <style>
      .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 200px;
        margin: 0;
      }
      
      .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
      }
      
      .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
      }
    </style>
    
    Expand Copy Copy

    # Direction

    By default, direction is horizontal. Set to vertical for vertical display.

    1

    2

    3

    <template>
      <fx-carousel height="200px" direction="vertical" :autoplay="false">
        <fx-carousel-item v-for="item in 3" :key="item">
          <h3 class="medium">{{ item }}</h3>
        </fx-carousel-item>
      </fx-carousel>
    </template>
    
    <style>
      .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 200px;
        margin: 0;
      }
      
      .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
      }
      
      .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
      }
    </style>
    
    Expand Copy Copy
    Collapse
    Object Detail

    ← Collapse Object Detail→

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式