<slider>
0.4 cn
Summary
A slide's player to show slides (mostly as pictures) one page by another. The default interval between two slides is 3 seconds.
Child Components
It supports all kinds of weex components as its slides, especially the indicator component which can be used only as a child component of slider.
Attributes
auto-play: <boolean>true|false. This value determines whether the slides plays automatically after the page rendering finished. The default value isfalse.index: <number> . This value determines the index of current shown slide. The default value is0.
Other attributes please check out the common attributes.
Styles
common styles: check out common styles for components
- support flexbox related styles
- support box model related styles
- support
positionrelated styles - support
opacity,background-coloretc.
Events
change: triggerd when the slide's index is changed. The event object contains the attribute ofindex, which is the index number of the currently shown slide.
common events: check out the common events
- support
clickevent. Check out common events - support
appear/disappearevent. Check out common events
Example
<template>
<div>
<slider auto-play="true" onchange="change" style="...">
<image repeat="{{imageList}}" src="{{src}}" style="..."></image>
<indicator></indicator>
</slider>
</div>
</template>
<script>
module.exports = {
data: {
imageList: [{src: '...'}, {src: '...'}, ...]
},
methods: {
change: function (e) {
// e.index
}
}
}
</script>