tree: f67f229d844dbe2640362ec1eebffd3347a0e268 [path history] [tgz]
  1. index.js
  2. index.vue
  3. package.json
  4. README.md
  5. README_cn.md
packages/wxc-lightbox/README.md

wxc-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

    

Code Example

<template>
  <div class="demo-container">
    <div class="btn" @click="openLightBox">
      <text class="btn-txt">Click the button</text>
    </div>
    <wxc-lightbox
      ref="wxc-lightbox"
      height="800"
      :show="show"
      :image-list="imageList"
      @wxcLightboxOverlayClicked="wxcLightboxOverlayClicked">
    </wxc-lightbox>
  </div>
</template>

<script>
  import { WxcLightbox } from 'weex-ui';
  export default {
    components: {
      WxcLightbox
    },
    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;
      },
      wxcLightboxOverlayClicked () {
        this.show = false;
      }
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
showBoolYfalsewhether to show the light box
imageListArrayY[]image list
heightNumberY750light box height
widthNumberY750light box width
show-indicatorBoolNtruewhether to show indicator
indicator-colorObjectN{}indicator style(*1)
indexNumberN0the index of current shown slider
intervalNumberN3000time interval for each page displayed in slider
opacityNumberN0.6set transparency

*1 default style:

{'item-color': 'rgba(255, 195, 0, .5)','item-selected-color': '#ffc300','item-size': '20px'}

Event

// @wxcLightboxOverlayClicked="wxcLightboxOverlayClicked"