[Vuejs]-Use popup gallery with index

0👍

Maybe you can make your photos to object in script. Like the blow.

images:[{src:require("your path"),}]

Then control isOpen with methods to choose which one should be popup now.

<Popup :open="isOpen" @close="isOpen = !isOpen">
      <template #img><img :src="images[imgIndex].src"/></template>
</Popup>
imgClick(index){
            this.isOpen = true;
            switch(index){
                case 0: this.imgIndex = 0; break...
            }
        },

Leave a comment