API
Component

Carousel ($UI/system/components/bootstrap/carousel/carousel)

使用范围:UI2

Contents

component Carousel ($UI/system/components/bootstrap/carousel/carousel) extends ViewComponent

<b>使用场景</b>:轮播效果,类似各大电商首页轮播; <b>使用方法</b>:添加carousel组件,绑定要展示的图片数据;

	
	

Constructor Top

  Carousel ()
  Carousel ( options)

Attributes Top

boolean auto

自动播放

integer interval

自动播放的间隔,单位是秒

string xid

Methods Top

void add (String html)
void next (function fn)
void prev (function fn)
void remove (integer index)
void removeAll ()
void to (integer | String xidOrIdx, function fn)

Operations Top

void next ()
void prev ()
void to (String xid)

Events Top

void onSwiperChange (Result event)

Constructor details Top

public Carousel ()

<b>使用场景</b>:轮播效果,类似各大电商首页轮播; <b>使用方法</b>:添加carousel组件,绑定要展示的图片数据;

	
	

public Carousel ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Attributes Detail Top

public boolean auto

自动播放

public integer interval

自动播放的间隔,单位是秒

public string xid

Methods Detail Top

public void add (String html)

添加页

Parameters

String html

添加的html片断

Return Value

void

public void next (function fn)

切换到下一个content

Parameters

function fn

切换完成执行的方法, 可选

Return Value

void

public void prev (function fn)

切换到前一个content

Parameters

function fn

切换完成执行的方法, 可选

Return Value

void

public void remove (integer index)

删除页

Parameters

integer index

删除页的索引

Return Value

void

public void removeAll ()

删除所有页

Return Value

void

public void to (integer | String xidOrIdx, function fn)

切换到指定的content

Parameters

integer | String xidOrIdx

panel的xid或者索引

function fn

切换完成执行的方法, 可选

Return Value

void

Operations Detail Top

public void next ()

切换到下一个content

See Next

Return Value

void

public void prev ()

切换到前一个content

See Prev

Return Value

void

public void to (String xid)

切换到指定的content

See To

Parameters

String xid

Return Value

void

Events Detail Top

public void onSwiperChange (Result event)

轮播页发生变化时触发

Parameters

Result event

Return Value

void