van-image mobile terminal click picture preview

van-image to preview the picture, click on the picture to preview the big picture

The renderings are as follows:

Here is the code:

<div>
          <van-image :src="imgTest.icon" @click="showPreview(imgTest.icon)"/> 
          <van-image-preview v-model="showImg" :images="icons"></van-image-preview>
 </div>



export default {
       name:'formDemo',
        data() {
            return {
                 showImg:false,
                  icons:[],
                  imgTest:{
                          desc:"锦觅", 
                          icon:require('../../images/jinmi.png'),
                          isCheck:"Y",
                          value:"jinmi",
                        },
                }
        },
        methods: {
             showPreview(url){
                this.icons.push(url);
                this.showImg=true;
              },

        }



}

Guess you like

Origin blog.csdn.net/ss_Tina/article/details/129879482