lighting-ui
Version:
A rich interaction, lightweight, high performance UI library based on Weex
83 lines (69 loc) • 2.49 kB
Markdown
# lc-lightbox
> Picture list of full screen display
### Rule
- Often used for the detailed page of the image to enlarge the display, let the user see the effect clearly.
- You can pass in a set of images, slide shows.
## [Demo](https://h5.m.taobao.com/trip/lc-lightbox/index.html?_wx_tpl=https%3A%2F%2Fh5.m.taobao.com%2Ftrip%2Flc-lightbox%2Fdemo%2Findex.native-min.js)
<img src="https://gw.alipayobjects.com/zos/rmsportal/RzbkfaSHRYaJzdPrsgLj.gif" width="240"/> <img src="https://img.alicdn.com/tfs/TB1BGPdSpXXXXajaVXXXXXXXXXX-200-200.png" width="160"/>
## Code Example
```vue
<template>
<div class="demo-container">
<text class="image-text">Click the image</text>
<div class="btn" @click="openLightBox">
<text class="btn-txt">Click the button</text>
</div>
<lc-lightbox
ref="lc-lightbox"
height="800"
:show="show"
:image-list="imageList"
@LcLightboxOverlayClicked="LcLightboxOverlayClicked">
</lc-lightbox>
</div>
</template>
<script>
import { LcLightbox } from 'weex-ui';
export default {
components: {
LcLightbox
},
data: function () {
return {
imageList: [
{ src: 'https://gd2.alicdn.com/bao/uploaded/i2/T14H1LFwBcXXXXXXXX_!!0-item_pic.jpg' },
{ src: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1PXJCJFXXXXciXFXXXXXXXXXX_!!0-item_pic.jpg' },
{ src: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1x6hYLXXXXXazXVXXXXXXXXXX_!!0-item_pic.jpg' }
],
show: false
};
},
methods: {
openLightBox () {
this.show = true;
},
LcLightboxOverlayClicked () {
this.show = false;
}
}
};
</script>
```
More details can be found in [here](https://github.com/alibaba/weex-ui/blob/master/example/lightbox/index.vue)
### API
| Prop | Type | Required | Default | Description |
|-------------|------------|--------|-----|-----|
| show | `Bool` |`Y`| `false` | whether to show the light box |
| imageList | `Array` |`Y`| `[]` | image list |
| height | `Number` |`Y`| `750` | light box height |
| width | `Number` |`Y`| `750` | light box width |
| show-indicator | `Bool` |`N`| `true` |whether to show indicator|
| indicator-color | `Object` |`N`| `{}` | indicator style(*1)|
*1 default style:
```
{'item-color': 'rgba(255, 195, 0, .5)','item-selected-color': '#ffc300','item-size': '20px'}
```
### Event
```
// @LcLightboxOverlayClicked="LcLightboxOverlayClicked"
```