vue-preview thumbnails

  If we want to use vue thumbnails, you can use plug-vue-preview

  Small thumbnail map

  

  Style big picture

  

  Usage: vue-preview

  Down: npm i vue-preview

  Usage: In the src directory in main.js

       import VuePreview from 'vue-preview'

       Vue.use(VuePreview) 

       In the components that need thumbnails using 

        template written

        <div>
          <vue-preview :slides="list" @close="handleClose"></vue-preview>
        </div>

       Note: list is the picture of our circulation

       Used in the script exprot default {} in the list of data for use in a data format

      list[
                {
                    src'https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_b.jpg',
                    msrc'https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_m.jpg',
                    w600,
                    h400
                },
                {
                    src'https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_b.jpg',
                    msrc'https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_m.jpg',
                    w1200,
                    h900
                }
            ]
  Note: This msrc, w, h these three attributes are required for less, will not work
  vue-preview of the style can only be a global style, they are not available in local
  In this case, we can effect the page, can see it, but we need to pay attention to layout, we can only typeset in a global environment, it is best to become public following style style
  
  .my-gallery:after{
    content:"";
    display:block;
    visibility: hidden;
    clear:both;
    height:0
  }
  .my-gallery figure{
    width:100px;
    height:100px;
    float:left;
    margin:.100px;
    padding:0;
    box-shadow:0 0 .100px #ccc;
    }

 

 

Guess you like

Origin www.cnblogs.com/shangjun6/p/11323866.html